From: Tom Lane <tgl@sss.pgh.pa.us>
To: nico@cryptonector.com
Cc: pgsql-bugs@lists.postgresql.org
Subject: Re: BUG #18825: Row value equality predicates do not use indices
Date: Tue, 25 Feb 2025 19:44:42 -0500
Message-ID: <1678855.1740530682@sss.pgh.pa.us> (raw)
In-Reply-To: <18825-5c25a6ba19fa6549@postgresql.org>
References: <18825-5c25a6ba19fa6549@postgresql.org>
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-bugs@postgresql.org
Cc: tgl@sss.pgh.pa.us, nico@cryptonector.com, pgsql-bugs@lists.postgresql.org
Subject: Re: BUG #18825: Row value equality predicates do not use indices
In-Reply-To: <1678855.1740530682@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox