David Rowley <dgrowleyml@gmail.com> writes:
> On Thu, 15 Jun 2023 at 11:59, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>> But how did it decide that the partial index is predOK, if there's not
>> a qual forcing a_id to not be null?
> In this case a.id = b.a_id AND c.id = b.c_id are used as proofs. I
> didn't debug all the way, but I assume we deduce that the NOT NULL
> index is ok due to the strict join quals.
Ah. So the index is okay to use as far as the final result is
concerned, but it's not okay for the purpose to which it's being put.
I concur that we'd better just not use partial indexes in
relation_has_unique_index_for.
regards, tom lane