Re: BUG #18825: Row value equality predicates do not use indices - Mailing list pgsql-bugs

From Tom Lane
Subject Re: BUG #18825: Row value equality predicates do not use indices
Date
Msg-id 1678855.1740530682@sss.pgh.pa.us
Whole thread Raw
In response to BUG #18825: Row value equality predicates do not use indices  (PG Bug reporting form <noreply@postgresql.org>)
List pgsql-bugs
PG Bug reporting form <noreply@postgresql.org> writes:
> DELETE FROM foo USING (SELECT dels FROM dels) AS dels
> WHERE foo = dels; -- <--- does not use indices on either table

[ shrug... ]  Works for me given the full-row indexes, although I do
have to force enable_seqscan off or reduce random_page_cost a lot,
because otherwise the planner thinks a seqscan-and-sort is cheaper.
I strongly suspect it's right, because full-row indexes are going to
be bigger than the table proper.  The mere fact that a plan uses
indexes does not automatically make it better than one that doesn't.

Anyway, AFAICS your gripe has nothing to do with "can the planner
use these indexes", and everything to do with its cost estimates
about the value of doing it that way.

            regards, tom lane



pgsql-bugs by date:

Previous
From: PG Bug reporting form
Date:
Subject: BUG #18825: Row value equality predicates do not use indices
Next
From: Kashaela Ransaw
Date:
Subject: Re: error -10825