postgresql/src/include/commands
Alvaro Herrera 5de890e361
Add EXPLAIN (MEMORY) to report planner memory consumption
This adds a new "Memory:" line under the "Planning:" group (which
currently only has "Buffers:") when the MEMORY option is specified.

In order to make the reporting reasonably accurate, we create a separate
memory context for planner activities, to be used only when this option
is given.  The total amount of memory allocated by that context is
reported as "allocated"; we subtract memory in the context's freelists
from that and report that result as "used".  We use
MemoryContextStatsInternal() to obtain the quantities.

The code structure to show buffer usage during planning was not in
amazing shape, so I (Álvaro) modified the patch a bit to clean that up
in passing.

Author: Ashutosh Bapat
Reviewed-by: David Rowley, Andrey Lepikhov, Jian He, Andy Fan
Discussion: https://www.postgresql.org/message-id/CAExHW5sZA=5LJ_ZPpRO-w09ck8z9p7eaYAqq3Ks9GDfhrxeWBw@mail.gmail.com
2024-01-29 17:53:03 +01:00
..
alter.h Update copyright for 2024 2024-01-03 20:49:05 -05:00
async.h Update copyright for 2024 2024-01-03 20:49:05 -05:00
cluster.h Update copyright for 2024 2024-01-03 20:49:05 -05:00
collationcmds.h Update copyright for 2024 2024-01-03 20:49:05 -05:00
comment.h Update copyright for 2024 2024-01-03 20:49:05 -05:00
conversioncmds.h Update copyright for 2024 2024-01-03 20:49:05 -05:00
copy.h Rename COPY option from SAVE_ERROR_TO to ON_ERROR 2024-01-19 15:15:51 +02:00
copyfrom_internal.h Add new COPY option SAVE_ERROR_TO 2024-01-16 23:08:53 +02:00
createas.h Update copyright for 2024 2024-01-03 20:49:05 -05:00
dbcommands.h Update copyright for 2024 2024-01-03 20:49:05 -05:00
dbcommands_xlog.h Update copyright for 2024 2024-01-03 20:49:05 -05:00
defrem.h Add temporal PRIMARY KEY and UNIQUE constraints 2024-01-24 16:34:37 +01:00
discard.h Update copyright for 2024 2024-01-03 20:49:05 -05:00
event_trigger.h Update copyright for 2024 2024-01-03 20:49:05 -05:00
explain.h Add EXPLAIN (MEMORY) to report planner memory consumption 2024-01-29 17:53:03 +01:00
extension.h Update copyright for 2024 2024-01-03 20:49:05 -05:00
lockcmds.h Update copyright for 2024 2024-01-03 20:49:05 -05:00
matview.h Update copyright for 2024 2024-01-03 20:49:05 -05:00
policy.h Update copyright for 2024 2024-01-03 20:49:05 -05:00
portalcmds.h Update copyright for 2024 2024-01-03 20:49:05 -05:00
prepare.h Update copyright for 2024 2024-01-03 20:49:05 -05:00
proclang.h Update copyright for 2024 2024-01-03 20:49:05 -05:00
progress.h Add progress reporting of skipped tuples during COPY FROM. 2024-01-25 10:57:41 +09:00
publicationcmds.h Update copyright for 2024 2024-01-03 20:49:05 -05:00
schemacmds.h Update copyright for 2024 2024-01-03 20:49:05 -05:00
seclabel.h Update copyright for 2024 2024-01-03 20:49:05 -05:00
sequence.h Update copyright for 2024 2024-01-03 20:49:05 -05:00
subscriptioncmds.h Update copyright for 2024 2024-01-03 20:49:05 -05:00
tablecmds.h Update copyright for 2024 2024-01-03 20:49:05 -05:00
tablespace.h Update copyright for 2024 2024-01-03 20:49:05 -05:00
trigger.h Update copyright for 2024 2024-01-03 20:49:05 -05:00
typecmds.h Update copyright for 2024 2024-01-03 20:49:05 -05:00
user.h Add new GUC createrole_self_grant. 2023-01-10 12:44:49 -05:00
vacuum.h Make attstattarget nullable 2024-01-13 18:14:53 +01:00
view.h Update copyright for 2024 2024-01-03 20:49:05 -05:00