Re: [PATCH] bitmap indexes - Mailing list pgsql-hackers

From Jeff Janes
Subject Re: [PATCH] bitmap indexes
Date
Msg-id CAMkU=1yPwJNvOLfDK2oXNWdL_x19K9L_Q_d6X=_+g-iNsPYFew@mail.gmail.com
Whole thread Raw
In response to [PATCH] bitmap indexes  (Abhijit Menon-Sen <ams@2ndquadrant.com>)
Responses Re: [PATCH] bitmap indexes
List pgsql-hackers
On Sat, Sep 14, 2013 at 11:14 AM, Abhijit Menon-Sen <ams@2ndquadrant.com> wrote:
Hi.

This is a cleaned-up and rebased version of the bitmap index patch from
Gavin Sherry, later revised by Gianni Ciolli and Gabriele Bartolini, and
others including Daniel Bausch.

I've been working on this patch for a while, and have made some progress
towards (a) general fixing, and (b) a working VACUUM implementation (the
major remaining piece). Unfortunately, I've been busy moving house, and
the latter is not complete (and not in this patch).

I will continue working on the code, and I'll post updates. I expect to
have more to show in just a few days.

Nevertheless, I'm posting it for review now as I keep working. Given the
size and age of the patch, I would appreciate any comments, no matter
how nitpicky.

Hi Abhijit,

I get wrong answers from this index sometimes.  It seems to occur when the position of the column within the index is not the same as its position within the table.  So I think that what is happening is somewhere the offset into the list of table columns is misused to offset into the list of index columns.

I didn't see any XXX notes that indicate this is a known problem.

create table foo as select 
   floor(random()*10) as a, 
   floor(random()*10) as b, 
   floor(random()*10) as c,
  d 
from generate_series(1,10000000) d;

vacuum ANALYZE;
create index on foo using bitmap (a);
create index on foo using bitmap (b);

select count(*) from foo where a=4;
1000173
select count(*) from foo where a+0=4;
1000173

select count(*) from foo where b=4;
0
select count(*) from foo where b+0=4;
999750

Cheers,

Jeff

pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: SSL renegotiation
Next
From: Alvaro Herrera
Date:
Subject: Re: FW: REVIEW: Allow formatting in log_line_prefix