RangeTblEntry jumble omissions
Peter Eisentraut <peter@eisentraut.org>
From: Peter Eisentraut <peter@eisentraut.org>
To: pgsql-hackers <pgsql-hackers@postgresql.org>
Date: 2024-02-23T15:26:53Z
Lists: pgsql-hackers
Attachments
- 0001-Add-more-RangeTblEntry-fields-to-jumble.patch (text/plain) patch 0001
I think there are some fields from the RangeTblEntry struct missing in the jumble (function _jumbleRangeTblEntry()). Probably, some of these were really just forgotten, in other cases this might be an intentional decision, but then it might be good to document it. This has come up in thread [0] and there is a patch [1], but I figured I'd start a new thread here to get the attention of those who know more about pg_stat_statements. I think the following fields are missing. (See also attached patch.) - alias Currently, two queries like SELECT * FROM t1 AS foo SELECT * FROM t1 AS bar are counted together by pg_stat_statements -- that might be ok, but they both get listed under whichever one is run first, so here if you are looking for the "AS bar" query, you won't find it. - join_using_alias Similar situation, currently SELECT * FROM t1 JOIN t2 USING (a, b) SELECT * FROM t1 JOIN t2 USING (a, b) AS x are counted together. - funcordinality This was probably just forgotten. It should be included because the WITH ORDINALITY clause changes the query result. - lateral Also probably forgotten. A query specifying LATERAL is clearly different from one without it. Thoughts? Anything else missing perhaps? [0]: https://www.postgresql.org/message-id/flat/4b27fc50-8cd6-46f5-ab20-88dbaadca645@eisentraut.org [1]: https://www.postgresql.org/message-id/attachment/154249/v2-0002-Remove-custom-_jumbleRangeTblEntry.patch
Commits
-
Add missing RangeTblEntry field to jumble
- 8b29a119fdaa 17.0 landed