summaryrefslogtreecommitdiff
path: root/src/backend/utils/misc/guc_tables.c
diff options
context:
space:
mode:
authorDavid Rowley <drowley@postgresql.org>2025-11-06 16:34:55 +1300
committerDavid Rowley <drowley@postgresql.org>2025-11-06 16:34:55 +1300
commiteaa159632d034a59ede1695f4b86098b1a372b48 (patch)
tree3302fde0872fb7cf0805fa6aa99ccd264fc9df65 /src/backend/utils/misc/guc_tables.c
parenta3ebec4e4cf6625a2bab4db2830d57d25a34ba1f (diff)
Fix UNION planner estimate_num_groups with varno==0
03d40e4b5 added code to provide better row estimates for when a UNION query ended up only with a single child due to other children being found to be dummy rels. In that case, ordinarily it would be ok to call estimate_num_groups() on the targetlist of the only child path, however that's not safe to do if the UNION child is the result of some other set operation as we generate targetlists containing Vars with varno==0 for those, which estimate_num_groups() can't handle. This could lead to: ERROR: XX000: no relation entry for relid 0 Fix this by avoiding doing this when the only child is the result of another set operation. In that case we'll fall back on the assume-all-rows-are-unique method. Reported-by: Alexander Lakhin <exclusion@gmail.com> Author: David Rowley <dgrowleyml@gmail.com> Discussion: https://postgr.es/m/cfbc99e5-9d44-4806-ba3c-f36b57a85e21@gmail.com
Diffstat (limited to 'src/backend/utils/misc/guc_tables.c')
0 files changed, 0 insertions, 0 deletions