Re: Generating code for query jumbling through gen_node_support.pl
Michael Paquier <michael@paquier.xyz>
From: Michael Paquier <michael@paquier.xyz>
To: Peter Eisentraut <peter.eisentraut@enterprisedb.com>
Cc: Postgres hackers <pgsql-hackers@lists.postgresql.org>, "Drouvot, Bertrand" <bdrouvot@amazon.com>
Date: 2023-02-05T10:40:57Z
Lists: pgsql-hackers
Attachments
- jumble-aconst.patch (text/x-diff) patch
On Tue, Jan 31, 2023 at 03:40:56PM +0900, Michael Paquier wrote: > With all that in mind, I have spent my day polishing that and doing a > close lookup, and the patch has been applied. Thanks a lot! While working on a different patch, I have noticed a small issue in the way the jumbling happens for A_Const, where ValUnion was not getting jumbled correctly. This caused a few statements that rely on this node to compile the same query IDs when using different values. The full contents of pg_stat_statements for a regression database point to: - SET. - COPY with queries. - CREATE TABLE with partition bounds and default expressions. This was causing some confusion in pg_stat_statements where some utility queries would be incorrectly reported, and at this point the intention is to keep this area compatible with the string-based method when it comes to the values. Like read, write and copy nodes, we need to compile the query ID based on the type of the value, which cannot be automated. Attached is a patch to fix this issue with some regression tests, that I'd like to get fixed before moving on with more business in pg_stat_statements (aka properly show Const nodes for utilities with normalized queries). Comments or objections are welcome, of course. (FWIW, I'd like to think that there is an argument to normalize the A_Const nodes for a portion of the DDL queries, by ignoring their values in the query jumbling and mark a location, which would be really useful for some workloads, but that's a separate discussion I am keeping for later.) -- Michael
Commits
-
Mark more nodes with attribute no_query_jumble
- 2a507f6fd8b7 16.0 landed
-
Include values of A_Const nodes in query jumbling
- 9ba37b2cb6a1 16.0 landed
-
Generate code for query jumbling through gen_node_support.pl
- 3db72ebcbe20 16.0 landed
-
Rework format of comments in headers for nodes
- 5d29d525ffe0 16.0 landed
-
Move queryjumble.c code to src/backend/nodes/
- 8eba3e3f0208 16.0 landed
-
Fix some compiler warnings in aset.c and generation.c
- b82557ecc2eb 16.0 cited
-
Reformat some node comments
- 835d476fd21b 16.0 cited