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 <
[email protected]>
Reviewed-by: Sergey Dudoladov (mysterious, off-list)
Reviewed-by: David Geier
Reviewed-by: Robert Haas
Reviewed-by: Álvaro Herrera
Reviewed-by: Sami Imseih
Reviewed-by: Sutou Kouhei
Reviewed-by: Tom Lane
Reviewed-by: Michael Paquier
Reviewed-by: Marcos Pegoraro
Reviewed-by: Julien Rouhaud
Reviewed-by: Zhihong Yu
Tested-by: Yasuo Honda
Tested-by: Sergei Kornilov
Tested-by: Maciek Sakrejda
Tested-by: Chengxi Sun
Tested-by: Jakub Wartak
Discussion: https://postgr.es/m/CA+q6zcWtUbT_Sxj0V6HY6EZ89uv5wuG5aefpe_9n0Jr3VwntFg@mail.gmail.com