postgresql/src/backend
Fujii Masao 9d701e624f Rework EXPLAIN for planner's buffer usage.
Commit ce77abe63c allowed EXPLAIN (BUFFERS) to report the information
on buffer usage during planning phase. However three issues were
reported regarding this feature.

(1) Previously, EXPLAIN option BUFFERS required ANALYZE. So the query
    had to be actually executed by specifying ANALYZE even when we
    want to see only the planner's buffer usage. This was inconvenient
    especially when the query was write one like DELETE.

(2) EXPLAIN included the planner's buffer usage in summary
    information. So SUMMARY option had to be enabled to report that.
    Also this format was confusing.

(3) The output structure for planning information was not consistent
    between TEXT format and the others. For example, "Planning" tag
    was output in JSON format, but not in TEXT format.

For (1), this commit allows us to perform EXPLAIN (BUFFERS) without
ANALYZE to report the planner's buffer usage.

For (2), this commit changed EXPLAIN output so that the planner's
buffer usage is reported before summary information.

For (3), this commit made the output structure for planning
information more consistent between the formats.

Back-patch to v13 where the planner's buffer usage was allowed to
be reported in EXPLAIN.

Reported-by: Pierre Giraud, David Rowley
Author: Fujii Masao
Reviewed-by: David Rowley, Julien Rouhaud, Pierre Giraud
Discussion: https://postgr.es/m/07b226e6-fa49-687f-b110-b7c37572f69e@dalibo.com
2020-08-21 20:48:59 +09:00
..
access Revert "Make vacuum a bit more verbose to debug BF failure." 2020-08-20 12:59:00 -07:00
bootstrap Be more careful about marking catalog columns NOT NULL by default. 2020-07-21 13:03:48 -04:00
catalog Add pg_backend_memory_contexts system view. 2020-08-19 15:34:43 +09:00
commands Rework EXPLAIN for planner's buffer usage. 2020-08-21 20:48:59 +09:00
executor Be more careful about the shape of hashable subplan clauses. 2020-08-14 22:14:03 -04:00
foreign Update copyrights for 2020 2020-01-01 12:21:45 -05:00
jit Fix a few typos in JIT comments and README 2020-08-21 09:33:56 +12:00
lib Use pg_bitutils for HyperLogLog. 2020-07-30 09:14:23 -07:00
libpq code: replace most remaining uses of 'master'. 2020-07-08 13:24:35 -07:00
main Clean up includes of s_lock.h. 2020-06-18 19:41:05 -07:00
nodes Suppress unnecessary RelabelType nodes in yet more cases. 2020-08-19 14:07:49 -04:00
optimizer Suppress unnecessary RelabelType nodes in yet more cases. 2020-08-19 14:07:49 -04:00
parser Rename field "relkind" to "objtype" for CTAS and ALTER TABLE nodes 2020-07-11 13:32:28 +09:00
partitioning Fix yet another issue with step generation in partition pruning. 2020-08-07 14:45:00 +09:00
po Translation updates 2020-05-18 12:49:30 +02:00
port Add huge_page_size setting for use on Linux. 2020-07-17 14:33:00 +12:00
postmaster snapshot scalability: Move PGXACT->vacuumFlags to ProcGlobal->vacuumFlags. 2020-08-14 15:33:35 -07:00
regex Dial back -Wimplicit-fallthrough to level 3 2020-05-13 15:31:14 -04:00
replication snapshot scalability: cache snapshots using a xact completion counter. 2020-08-17 21:08:30 -07:00
rewrite Add missing invocations to object access hooks 2020-05-23 14:03:04 +09:00
snowball code: replace most remaining uses of 'master'. 2020-07-08 13:24:35 -07:00
statistics Run pgindent with new pg_bsd_indent version 2.1.1. 2020-05-16 11:54:51 -04:00
storage Fix typos in comments. 2020-08-21 12:35:22 +09:00
tcop Rename field "relkind" to "objtype" for CTAS and ALTER TABLE nodes 2020-07-11 13:32:28 +09:00
tsearch Fix recently-introduced performance problem in ts_headline(). 2020-07-31 11:43:12 -04:00
utils Add pg_backend_memory_contexts system view. 2020-08-19 15:34:43 +09:00
.gitignore Add .gitignore entries for AIX-specific intermediate build artifacts. 2015-07-08 20:44:22 -04:00
Makefile Update copyrights for 2020 2020-01-01 12:21:45 -05:00
common.mk Remove PARTIAL_LINKING build mode. 2018-03-30 17:33:04 -07:00
nls.mk Add missing gettext triggers 2020-04-28 13:35:40 +02:00