Re: query_id: jumble names of temp tables for better pg_stat_statement UX
Tom Lane <tgl@sss.pgh.pa.us>
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Julien Rouhaud <rjuju123@gmail.com>
Cc: Sami Imseih <samimseih@gmail.com>, Michael Paquier <michael@paquier.xyz>,
Christoph Berg <myon@debian.org>,
PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>,
ma lz <ma100@hotmail.com>
Date: 2025-03-25T05:17:22Z
Lists: pgsql-hackers, pgsql-general
Julien Rouhaud <rjuju123@gmail.com> writes: > On Tue, Mar 25, 2025 at 12:32:05AM -0400, Tom Lane wrote: >> 2. Tools that are not entitled to set the value of the GUC are forced >> to be prepared to cope with any setting. That can be anywhere from >> painful to impossible. > Didn't that ship already sailed in pg14 when we allowed generating custom > query_id? Up to a point, perhaps. If I'm writing some kind of tool that digests pg_stat_statements results, I think I'm entitled to disregard the possibility that somebody is using a custom query_id that behaves in ways I'm not expecting --- or at least, fixing my code for that is their problem not mine. But it's much harder to take that attitude for things that are built into core PG. >> For the specific context of controlling how query jumbling happens, >> there's still another problem: the actual statement-merging behavior of >> pg_stat_statements will depend on the totality of settings of the GUC >> across the entire system. > One of the requirement for the custom query_id was that you shouldn't be > allowed to change the algorithm dynamically, at least not unless a superuser > agrees to maybe break everything, which is why compute_query_id is marked as > PGC_SUSET. I think that the same reasoning should apply here and if the GUC is > kept it should be at least at that level. Fully agreed. (Even SUSET is debatable in this situation, but I'm okay with it on the principle that superusers are expected to know what they're doing and accept the consequences.) regards, tom lane
Commits
Same data as JSON:
GET /api/v1/messages/:b64id/commits
the thread's linked commits as JSON, with link sources.
API reference →
-
Use relation name instead of OID in query jumbling for RangeTblEntry
- 787514b30bb7 18.0 landed
-
Fix two issues with custom_query_jumble in gen_node_support.pl
- 27ee6ede6bc9 18.0 landed
-
pg_stat_statements: Add more tests with temp tables and namespaces
- 3430215fe35f 18.0 landed
-
Add support for custom_query_jumble as a node field attribute
- 5ac462e2b7ac 18.0 landed