[PATCH] Allow SJE to recognize GiST-backed temporal primary keys - Mailing list pgsql-hackers

From SATYANARAYANA NARLAPURAM
Subject [PATCH] Allow SJE to recognize GiST-backed temporal primary keys
Date
Msg-id CAHg+QDeXwdOzrmb-sSATK4whbyhOgzyCGN+bY=YXU9qOzJaWSg@mail.gmail.com
Whole thread
Responses Re: [PATCH] Allow SJE to recognize GiST-backed temporal primary keys
List 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

pgsql-hackers by date:

Previous
From: Melanie Plageman
Date:
Subject: Re: eliminate xl_heap_visible to reduce WAL (and eventually set VM on-access)
Next
From: Matheus Alcantara
Date:
Subject: Re: MERGE PARTITIONS and DEPENDS ON EXTENSION.