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/



Reply via email to