| From: | SATYANARAYANA NARLAPURAM <satyanarlapuram(at)gmail(dot)com> |
|---|---|
| To: | PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>, Paul A Jungwirth <pj(at)illuminatedcomputing(dot)com> |
| Subject: | [PATCH] Allow SJE to recognize GiST-backed temporal primary keys |
| Date: | 2026-04-21 19:18:37 |
| Message-ID: | CAHg+QDeXwdOzrmb-sSATK4whbyhOgzyCGN+bY=YXU9qOzJaWSg@mail.gmail.com |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-hackers |
Hi Hackers,
relation_has_unique_index_for() checks whether join clause equality
operators belong to the index's opfamily via mergeopfamilies. Since
mergeopfamilies only lists btree opfamilies, this check always fails
for GiST-backed unique indexes such as those created by PRIMARY KEY
with WITHOUT OVERLAPS, preventing self-join elimination.
Fix by falling back to op_in_opfamily() when the mergeopfamilies check
fails. The clause is already known to be a mergejoinable equality, so
confirming the operator is registered in the index's opfamily is
sufficient to prove that the index's uniqueness guarantee applies.
Attached a patch to fix this and added corresponding tests.
Thanks,
Satya
| Attachment | Content-Type | Size |
|---|---|---|
| 0001-Allow-SJE-to-recognize-GiST-backed-temporal-primary-.patch | application/octet-stream | 4.4 KB |
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Matheus Alcantara | 2026-04-21 19:23:33 | Re: MERGE PARTITIONS and DEPENDS ON EXTENSION. |
| Previous Message | Melanie Plageman | 2026-04-21 18:41:30 | Re: eliminate xl_heap_visible to reduce WAL (and eventually set VM on-access) |