Re: Problem with Bitmap Heap Scan

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>
Cc: Rushabh Lathia <rushabh(dot)lathia(at)gmail(dot)com>, pgsql-hackers(at)postgresql(dot)org, rushabh(dot)lathia(at)enterprisedb(dot)com
Subject: Re: Problem with Bitmap Heap Scan
Date: 2008-11-20 17:02:46
Message-ID: 3274.1227200566@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com> writes:
> Tom Lane wrote:
>> Hmm, the ~~ condition should get treated as a "filter" not a "recheck".
>> I suppose I broke this somewhere ...

> I started to look at this last night. The culprit seems to be this patch:

Yeah, it appears that I oversimplified matters in that patch. I think
that I mistakenly decided that create_bitmap_subplan() only needed one
output parameter because there was no longer a need to distinguish
between lossy and nonlossy operators. What I forgot was that the
"nonlossy" output was also coming from the "indexquals" rather than
the "indexclauses", and that's different precisely in the case where
we've got a special index operator such as LIKE.

I think what probably has to happen is revert most of that
simplification and have create_bitmap_subplan return suitable
representations of both the indexquals and indexclauses.

> Attached is a patch that changes create_bitmap_subplan so that the
> condition put into Recheck condition is never stronger than the
> condition automatically handled by the index. Does that look right to you?

I think this is still too simplistic, but will look closer. One point
is that it's not accounting for the bitmap AND/OR structure that might
be above the individual indexscans. The original coding avoided that
problem by making all the decisions at the top level, and I'm inclined
to stick with that approach.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2008-11-20 17:28:01 Re: Re: [COMMITTERS] pgsql: Silence compiler warning about ignored return value.
Previous Message Andrew Dunstan 2008-11-20 16:55:51 Re: WIP parallel restore patch