postgresql/src/include/nodes
Michael Paquier dc68515968 Show values of SET statements as constants in pg_stat_statements
This is a continuation of work like 11c34b342b, done to reduce the
bloat of pg_stat_statements by applying more normalization to query
entries.  This commit is able to detect and normalize values in
VariableSetStmt, resulting in:
SET conf_param = $1

Compared to other parse nodes, VariableSetStmt is embedded in much more
places in the parser, impacting many query patterns in
pg_stat_statements.  A custom jumble function is used, with an extra
field in the node to decide if arguments should be included in the
jumbling or not, a location field being not enough for this purpose.
This approach allows for a finer tuning.

Clauses relying on one or more keywords are not normalized, for example:
* DEFAULT
* FROM CURRENT
* List of keywords.  SET SESSION CHARACTERISTICS AS TRANSACTION,
where it is critical to differentiate different sets of options, is a
good example of why normalization should not happen.

Some queries use VariableSetStmt for some subclauses with SET, that also
have their values normalized:
- ALTER DATABASE
- ALTER ROLE
- ALTER SYSTEM
- CREATE/ALTER FUNCTION

ba90eac7a9 has added test coverage for most of the existing SET
patterns.  The expected output of these tests shows the difference this
commit creates.  Normalization could be perhaps applied to more portions
of the grammar but what is done here is conservative, and good enough as
a starting point.

Author: Greg Sabino Mullane, Michael Paquier
Discussion: https://postgr.es/m/36e5bffe-e989-194f-85c8-06e7bc88e6f7@amazon.com
Discussion: https://postgr.es/m/B44FA29D-EBD0-4DD9-ABC2-16F1CB087074@amazon.com
Discussion: https://postgr.es/m/CAKAnmmJtJY2jzQN91=2QAD2eAJAA-Per61eyO48-TyxEg-q0Rg@mail.gmail.com
2024-09-30 14:02:00 +09:00
..
.gitignore Automatically generate node support functions 2022-07-09 08:53:59 +02:00
bitmapset.h Move some bitmap logic out of bitmapset.c 2024-03-06 14:30:16 +07:00
execnodes.h For inplace update durability, make heap_update() callers wait. 2024-09-24 15:25:18 -07:00
extensible.h Update copyright for 2024 2024-01-03 20:49:05 -05:00
lockoptions.h Update copyright for 2024 2024-01-03 20:49:05 -05:00
makefuncs.h Add temporal PRIMARY KEY and UNIQUE constraints 2024-09-17 11:29:30 +02:00
memnodes.h Add path column to pg_backend_memory_contexts view 2024-07-25 15:03:28 +12:00
meson.build Update copyright for 2024 2024-01-03 20:49:05 -05:00
miscnodes.h Update copyright for 2024 2024-01-03 20:49:05 -05:00
multibitmapset.h Update copyright for 2024 2024-01-03 20:49:05 -05:00
nodeFuncs.h Introduce an RTE for the grouping step 2024-09-10 12:35:34 +09:00
nodes.h Convert node test compile-time settings into run-time parameters 2024-08-01 10:09:18 +02:00
params.h Update copyright for 2024 2024-01-03 20:49:05 -05:00
parsenodes.h Show values of SET statements as constants in pg_stat_statements 2024-09-30 14:02:00 +09:00
pathnodes.h Introduce an RTE for the grouping step 2024-09-10 12:35:34 +09:00
pg_list.h Add macros for looping through a List without a ListCell. 2024-01-04 16:09:34 -06:00
plannodes.h Show number of disabled nodes in EXPLAIN ANALYZE output. 2024-08-21 10:14:35 -04:00
primnodes.h SQL/JSON: Always coerce JsonExpr result at runtime 2024-06-28 21:58:13 +09:00
print.h Update copyright for 2024 2024-01-03 20:49:05 -05:00
queryjumble.h revert: Transform OR clauses to ANY expression 2024-04-10 02:28:09 +03:00
readfuncs.h Convert node test compile-time settings into run-time parameters 2024-08-01 10:09:18 +02:00
replnodes.h Allow setting failover property in the replication command. 2024-01-29 09:37:23 +05:30
subscripting.h Update copyright for 2024 2024-01-03 20:49:05 -05:00
supportnodes.h Update copyright for 2024 2024-01-03 20:49:05 -05:00
tidbitmap.h Update copyright for 2024 2024-01-03 20:49:05 -05:00
value.h Update copyright for 2024 2024-01-03 20:49:05 -05:00