Re: Question about indexes - Mailing list pgsql-hackers

From Greg Stark
Subject Re: Question about indexes
Date
Msg-id 871xpktb38.fsf@stark.xeocode.com
Whole thread Raw
In response to Re: Question about indexes  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Question about indexes  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
Tom Lane <tgl@sss.pgh.pa.us> writes:

> Greg Stark <gsstark@mit.edu> writes:
> >
> > I would see that as the next step, But it seems to me it would be only a small
> > set of queries where it would really help enough to outweigh the extra work of
> > the sort.
> 
> What sort?  

To build the in-memory bitmap you effectively have to do a sort. If the tuples
come out of the index in heap order then you can combine them without having
to go through that step.

> I'm a little dubious that true bitmap indexes would be worth building
> for Postgres.  Seems like partial indexes cover the same sorts of
> applications and are more flexible.

I'm clear on the distinction. I think bitmap indexes still have a place, but
if regular btree indexes could be combined efficiently then that would be an
even narrower niche.

Partial indexes are very handy, and they're useful in corner cases where
bitmap indexes are useful, such as flags for special types of records.

But I think bitmap indexes are specifically wanted by certain types of data
warehousing applications where you have an index on virtually every column and
then want to do arbitrary boolean combinations of all of them. btree indexes
would generate more i/o scanning all the indexes than just doing a sequential
scan would. Whereas bitmap indexes are much denser on disk.

However my experience leans more towards the OLTP side and I very rarely saw
applications like this.



-- 
greg



pgsql-hackers by date:

Previous
From: Chris Bowlby
Date:
Subject: lock related issues...
Next
From: "scott.marlowe"
Date:
Subject: Re: Write cache