Re: BUG #18825: Row value equality predicates do not use indices

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: nico(at)cryptonector(dot)com
Cc: pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: Re: BUG #18825: Row value equality predicates do not use indices
Date: 2025-02-26 00:44:42
Message-ID: 1678855.1740530682@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

PG Bug reporting form <noreply(at)postgresql(dot)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

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Kashaela Ransaw 2025-02-26 03:28:43 Re: error -10825
Previous Message PG Bug reporting form 2025-02-25 22:24:36 BUG #18825: Row value equality predicates do not use indices