Squash constant lists in query jumbling by default - Mailing list pgsql-hackers

From Christoph Berg
Subject Squash constant lists in query jumbling by default
Date
Msg-id Z-LZyygkkNyA8-kR@msg.df7cb.de
Whole thread Raw
Responses Re: Squash constant lists in query jumbling by default
Re: Squash constant lists in query jumbling by default
List pgsql-hackers
Re: Álvaro Herrera
> 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.

The "jumble names of temp tables" thread was briefly touching this [1],
I'm starting a new thread since the others are already very long.

[1]
https://www.postgresql.org/message-id/flat/CAA5RZ0uNofEXfEfNw3uRN3D3oXkFPQ_s%2BhuLLHMKR_%2BMCk8RPQ%40mail.gmail.com#c357c56c3924642e8ef73cc1c8a0286e

Two points were made:

1) this should be on by default
2) there should be no GUC for it.

For 1), Sami said "Why would anyone not want to squash the IN list?"
to which I can only agree. Michael agreed as well, that's already +3.

For 2), Tom said that configurability is 1) often much less useful
than originally planned, and 2) tools have to cope with both settings
anyway, making implementing them harder. Plus, switching at run-time
makes the result even less predictable.

So, I would propose that we drop the GUC and make it the default.
Opinions?

Christoph



pgsql-hackers by date:

Previous
From: Noah Misch
Date:
Subject: Re: AIO v2.5
Next
From: Nikolay Shaplov
Date:
Subject: Re: vacuum_truncate configuration parameter and isset_offset