Re: Partial hash index is not used for implied qual. - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Partial hash index is not used for implied qual.
Date
Msg-id 1106189.1764033798@sss.pgh.pa.us
Whole thread Raw
In response to Re: Partial hash index is not used for implied qual.  (David Rowley <dgrowleyml@gmail.com>)
Responses Re: Partial hash index is not used for implied qual.
List pgsql-hackers
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



pgsql-hackers by date:

Previous
From: Rishu Bagga
Date:
Subject: Re: [PATCH] Write Notifications Through WAL
Next
From: Chao Li
Date:
Subject: Re: Remaining dependency on setlocale()