Re: Tracking per-RelOptInfo uniqueness during planning

From: Ilia Evdokimov <ilidock95(at)gmail(dot)com>
To: Antonin Houska <ah(at)cybertec(dot)at>, Richard Guo <guofenglinux(at)gmail(dot)com>
Cc: Pg Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>, Andy Fan <zhihuifan1213(at)163(dot)com>, David Rowley <dgrowleyml(at)gmail(dot)com>
Subject: Re: Tracking per-RelOptInfo uniqueness during planning
Date: 2026-10-12 09:25:38
Message-ID: 962c2428-e728-4af4-8ea1-e5247699b506@gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Would it make sense to add an `enable_uniquekeys GUC`, enabled by
default? UniqueKeys can eliminate DISTINCT/GROUP BY steps and mark joins
as inner-unique, so an incorrect uniqueness proof could affect query
results. A switch would help diagnose regressions and temporarily
disable the optimization if an issue is found. Eager aggregation and
self-join elimination already have such switches:
`enable_eager_aggregate` and `enable_self_join_elimination`.

--
Best regards,
Ilia Evdokimov,
Tantor Labs LLC,
https://tantorlabs.com/

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Bertrand Drouvot 2026-10-12 09:32:28 Re: POC: Unlocked path for GetSnapshotDataReuse
Previous Message Bertrand Drouvot 2026-10-12 09:22:57 Re: POC: Unlocked path for GetSnapshotDataReuse