Re: [HACKERS] partial indexes and bitmap scans - Mailing list pgsql-hackers

From Stephen Frost
Subject Re: [HACKERS] partial indexes and bitmap scans
Date
Msg-id 20170309170124.GK9812@tamriel.snowman.net
Whole thread Raw
In response to Re: [HACKERS] partial indexes and bitmap scans  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: [HACKERS] partial indexes and bitmap scans  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
Tom,

* Tom Lane (tgl@sss.pgh.pa.us) wrote:
> Stephen Frost <sfrost@snowman.net> writes:
> > Perhaps I'm missing something obvious, but isn't it a bit redundant to
> > have both a Recheck condition (which is the predicate of the index) and
> > a Filter condition (which is the user's predicate) when we've already
> > decided that the user's predicate must result in a subset of the
> > index's, as, otherwise, we wouldn't be able to use the index in the
> > first place?
>
> Yeah, I think this is just something that the planner doesn't see fit
> to expend cycles on detecting.

We have already figured out that the user's predicate results in a
subset of the index's or we wouldn't be able to use that index though,
right?  Do we really need to spend cycles re-discovering that?  Are
there cases where we actually need the index's predicate to ever be
included for correctness..?

This seems like we're going out of our way to add in an additional check
for something that we've already determined must always be true and that
strikes me as odd.

Thanks!

Stephen

pgsql-hackers by date:

Previous
From: Masahiko Sawada
Date:
Subject: Re: [HACKERS] GUC for cleanup indexes threshold.
Next
From: Robert Haas
Date:
Subject: Re: [HACKERS] Gather Merge