Allow left join removals and unique joins on partitioned tables
David Rowley <drowley@postgresql.org>
Allow left join removals and unique joins on partitioned tables This allows left join removals and unique joins to work with partitioned tables. The planner just lacked sufficient proofs that a given join would not cause any row duplication. Unique indexes currently serve as that proof, so have get_relation_info() populate the indexlist for partitioned tables too. Author: Arne Roland Reviewed-by: Alvaro Herrera, Zhihong Yu, Amit Langote, David Rowley Discussion: https://postgr.es/m/c3b2408b7a39433b8230bbcd02e9f302@index.de
Files
| Path | Change | +/− |
|---|---|---|
| src/backend/optimizer/util/plancat.c | modified | +149 −115 |
| src/backend/utils/adt/selfuncs.c | modified | +4 −0 |
| src/include/nodes/pathnodes.h | modified | +5 −5 |
| src/test/regress/expected/join.out | modified | +10 −0 |
| src/test/regress/expected/partition_join.out | modified | +2 −2 |
| src/test/regress/sql/join.sql | modified | +7 −0 |
| src/test/regress/sql/partition_join.sql | modified | +2 −2 |
Discussion
- missing indexes in indexlist with partitioned tables 31 messages · 2021-09-23 → 2023-01-09