From: Tom Lane <tgl@sss.pgh.pa.us>
To: David Rowley <dgrowleyml@gmail.com>
Cc: Sergei Glukhov <s.glukhov@postgrespro.ru>
Cc: pgsql-hackers@lists.postgresql.org
Subject: Re: Partial hash index is not used for implied qual.
Date: Mon, 24 Nov 2025 20:23:18 -0500
Message-ID: <1106189.1764033798@sss.pgh.pa.us> (raw)
In-Reply-To: <CAApHDvpVazvK7jAjpMWW5FYR4RQZ2NT8HidS03un8T+Ha8ZQDw@mail.gmail.com>
References: <e200bf38-6b45-446a-83fd-48617211feff@postgrespro.ru>
<CAApHDvpVazvK7jAjpMWW5FYR4RQZ2NT8HidS03un8T+Ha8ZQDw@mail.gmail.com>
David Rowley <dgrowleyml@gmail.com> writes:
> so, that leads me to believe the location you're adjusting is probably
> the best place to fix this issue.
Wouldn't it be better to handle it more like the is_target_rel logic
a few lines further up? I also object to putting the test between
the contain_mutable_functions and predicate_implied_by calls; that's
both confusing and probably wrong. We're only calling
contain_mutable_functions to guard an assumption that
predicate_implied_by makes.
A larger point is that I think leaving such quals in indrestrictinfo
probably distorts our estimates of indexscan costs: we are likely to
think they contribute selectivity when they don't. Maybe that's a
problem to address separately, but it should be looked at. We skated
past the same problem for is_target_rel cases on the grounds that that
consideration affects all indexes on the rel equally; but as proposed,
this will probably result in an improper bias towards a partial hash
index.
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-hackers@postgresql.org
Cc: tgl@sss.pgh.pa.us, dgrowleyml@gmail.com, s.glukhov@postgrespro.ru, pgsql-hackers@lists.postgresql.org
Subject: Re: Partial hash index is not used for implied qual.
In-Reply-To: <1106189.1764033798@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