postgresql/src/include/nodes
Michael Paquier 9c3caad026 Fix query jumbling with GROUP BY clauses
RangeTblEntry.groupexprs was marked with the node attribute
query_jumble_ignore, causing a list of GROUP BY expressions to be
ignored during the query jumbling.  For example, these two queries could
be grouped together within the same query ID:
SELECT count(*) FROM t GROUP BY a;
SELECT count(*) FROM t GROUP BY b;

However, as such queries use different GROUP BY clauses, they should be
split across multiple entries.

This fixes an oversight in 247dea89f7, that has introduced an RTE for
GROUP BY clauses.  Query IDs are documented as being stable across minor
releases, but as this is a regression new to v18 and that we are still
early in its support cycle, a backpatch is exceptionally done as this
has broken a behavior that exists since query jumbling is supported in
core, since its introduction in pg_stat_statements.

The tests of pg_stat_statements are expanded to cover this area, with
patterns involving GROUP BY and GROUPING clauses.

Author: Jian He <jian.universality@gmail.com>
Discussion: https://postgr.es/m/CACJufxEy2W+tCqC7XuJ94r3ivWsM=onKJp94kRFx3hoARjBeFQ@mail.gmail.com
Backpatch-through: 18
2026-01-14 08:44:52 +09:00
..
.gitignore Automatically generate node support functions 2022-07-09 08:53:59 +02:00
bitmapset.h Update copyright for 2025 2025-01-01 11:21:55 -05:00
execnodes.h Update obsolete comments in ResultRelInfo struct. 2025-08-17 19:40:01 +09:00
extensible.h Make it possible for loadable modules to add EXPLAIN options. 2025-03-18 08:41:12 -04:00
lockoptions.h Update copyright for 2025 2025-01-01 11:21:55 -05:00
makefuncs.h Update copyright for 2025 2025-01-01 11:21:55 -05:00
memnodes.h Update copyright for 2025 2025-01-01 11:21:55 -05:00
meson.build Move CompareType to separate header file 2025-02-02 08:11:57 +01:00
miscnodes.h Update copyright for 2025 2025-01-01 11:21:55 -05:00
multibitmapset.h Update copyright for 2025 2025-01-01 11:21:55 -05:00
nodeFuncs.h Update copyright for 2025 2025-01-01 11:21:55 -05:00
nodes.h Add support for custom_query_jumble as a node field attribute 2025-03-25 14:18:00 +09:00
params.h Update copyright for 2025 2025-01-01 11:21:55 -05:00
parsenodes.h Fix query jumbling with GROUP BY clauses 2026-01-14 08:44:52 +09:00
pathnodes.h Fix incorrect IndexOptInfo header comment 2025-11-24 17:00:50 +13:00
pg_list.h Swap order of extern/static and pg_nodiscard 2025-03-14 07:18:07 +01:00
plannodes.h Change internal plan ID type from uint64 to int64 2025-05-31 09:40:45 +09:00
primnodes.h Make query jumbling also squash PARAM_EXTERN params 2025-06-24 19:36:32 +02:00
print.h Update copyright for 2025 2025-01-01 11:21:55 -05:00
queryjumble.h Make query jumbling also squash PARAM_EXTERN params 2025-06-24 19:36:32 +02:00
readfuncs.h Update copyright for 2025 2025-01-01 11:21:55 -05:00
replnodes.h Update copyright for 2025 2025-01-01 11:21:55 -05:00
subscripting.h Update copyright for 2025 2025-01-01 11:21:55 -05:00
supportnodes.h Allow extension functions to participate in in-place updates. 2025-02-11 12:49:34 -05:00
tidbitmap.h Separate TBM[Shared|Private]Iterator and TBMIterateResult 2025-03-15 10:11:19 -04:00
value.h Update copyright for 2025 2025-01-01 11:21:55 -05:00