postgres/src/include/nodes
Álvaro Herrera 62d712ecfd
Introduce squashing of constant lists in query jumbling
pg_stat_statements produces multiple entries for queries like
    SELECT something FROM table WHERE col IN (1, 2, 3, ...)

depending on the number of parameters, because every element of
ArrayExpr is individually jumbled.  Most of the time that's undesirable,
especially if the list becomes too large.

Fix this by introducing a new GUC query_id_squash_values which modifies
the node jumbling code to only consider the first and last element of a
list of constants, rather than each list element individually.  This
affects both the query_id generated by query jumbling, as well as
pg_stat_statements query normalization so that it suppresses printing of
the individual elements of such a list.

The default value is off, meaning the previous behavior is maintained.

Author: Dmitry Dolgov <9erthalion6@gmail.com>
Reviewed-by: Sergey Dudoladov (mysterious, off-list)
Reviewed-by: David Geier <geidav.pg@gmail.com>
Reviewed-by: Robert Haas <robertmhaas@gmail.com>
Reviewed-by: Álvaro Herrera <alvherre@alvh.no-ip.org>
Reviewed-by: Sami Imseih <samimseih@gmail.com>
Reviewed-by: Sutou Kouhei <kou@clear-code.com>
Reviewed-by: Tom Lane <tgl@sss.pgh.pa.us>
Reviewed-by: Michael Paquier <michael@paquier.xyz>
Reviewed-by: Marcos Pegoraro <marcos@f10.com.br>
Reviewed-by: Julien Rouhaud <rjuju123@gmail.com>
Reviewed-by: Zhihong Yu <zyu@yugabyte.com>
Tested-by: Yasuo Honda <yasuo.honda@gmail.com>
Tested-by: Sergei Kornilov <sk@zsrv.org>
Tested-by: Maciek Sakrejda <m.sakrejda@gmail.com>
Tested-by: Chengxi Sun <sunchengxi@highgo.com>
Tested-by: Jakub Wartak <jakub.wartak@enterprisedb.com>
Discussion: https://postgr.es/m/CA+q6zcWtUbT_Sxj0V6HY6EZ89uv5wuG5aefpe_9n0Jr3VwntFg@mail.gmail.com
2025-03-18 18:56:11 +01:00
..
.gitignore Automatically generate node support functions 2022-07-09 08:53:59 +02:00
bitmapset.h Update copyright for 2025 2025-01-01 11:21:55 -05:00
execnodes.h BitmapHeapScan uses the read stream API 2025-03-15 10:34:42 -04:00
extensible.h Make it possible for loadable modules to add EXPLAIN options. 2025-03-18 08:41:12 -04:00
lockoptions.h Update copyright for 2025 2025-01-01 11:21:55 -05:00
makefuncs.h Update copyright for 2025 2025-01-01 11:21:55 -05:00
memnodes.h Update copyright for 2025 2025-01-01 11:21:55 -05:00
meson.build Move CompareType to separate header file 2025-02-02 08:11:57 +01:00
miscnodes.h Update copyright for 2025 2025-01-01 11:21:55 -05:00
multibitmapset.h Update copyright for 2025 2025-01-01 11:21:55 -05:00
nodeFuncs.h Update copyright for 2025 2025-01-01 11:21:55 -05:00
nodes.h Introduce squashing of constant lists in query jumbling 2025-03-18 18:56:11 +01:00
params.h Update copyright for 2025 2025-01-01 11:21:55 -05:00
parsenodes.h Add ALTER TABLE ... ALTER CONSTRAINT ... SET [NO] INHERIT 2025-03-05 13:50:22 +01:00
pathnodes.h Implement Self-Join Elimination 2025-02-17 12:44:12 +02:00
pg_list.h Swap order of extern/static and pg_nodiscard 2025-03-14 07:18:07 +01:00
plannodes.h Improve EXPLAIN's display of window functions. 2025-03-11 11:19:54 -04:00
primnodes.h Introduce squashing of constant lists in query jumbling 2025-03-18 18:56:11 +01:00
print.h Update copyright for 2025 2025-01-01 11:21:55 -05:00
queryjumble.h Introduce squashing of constant lists in query jumbling 2025-03-18 18:56:11 +01:00
readfuncs.h Update copyright for 2025 2025-01-01 11:21:55 -05:00
replnodes.h Update copyright for 2025 2025-01-01 11:21:55 -05:00
subscripting.h Update copyright for 2025 2025-01-01 11:21:55 -05:00
supportnodes.h Allow extension functions to participate in in-place updates. 2025-02-11 12:49:34 -05:00
tidbitmap.h Separate TBM[Shared|Private]Iterator and TBMIterateResult 2025-03-15 10:11:19 -04:00
value.h Update copyright for 2025 2025-01-01 11:21:55 -05:00