Thread: bit map indexes in postgres

bit map indexes in postgres

From
Mogin Mohandas
Date:
Hi all,
           Does anybody have any idea whether there is any Bit-map
Index functionality in Postgres. Atleast is there methods to extend
postgres with bit-map indexes. Also if anybody has any experience with
adding new data types to postgres server, please respond.
Thank you
Mogin

Re: bit map indexes in postgres

From
Brad Nicholson
Date:
Mogin Mohandas wrote:

>Hi all,
>           Does anybody have any idea whether there is any Bit-map
>Index functionality in Postgres. Atleast is there methods to extend
>postgres with bit-map indexes. Also if anybody has any experience with
>adding new data types to postgres server, please respond.
>Thank you
>Mogin
>
>

Bitmap indexs are coming in 8.1 (which is currently in beta).

--
Brad Nicholson  416-673-4106
Database Administrator, Afilias Canada Corp.



Re: bit map indexes in postgres

From
Chris Browne
Date:
bnichols@ca.afilias.info (Brad Nicholson) writes:
> Mogin Mohandas wrote:
>
>>Hi all,
>>           Does anybody have any idea whether there is any Bit-map
>>Index functionality in Postgres. Atleast is there methods to extend
>>postgres with bit-map indexes. Also if anybody has any experience with
>>adding new data types to postgres server, please respond.
>
> Bitmap indexs are coming in 8.1 (which is currently in beta).

It is worth noticing that these are not bitmaps on disk, but rather
are handled in memory.

Usage would be that you select the matching items from each relevant
b-tree index on disk so that the bitmap is established in memory.

From the release notes:

  Allow index scans to use an intermediate in-memory bitmap (Tom)

     In previous releases, only a single index could be used to do
     lookups on a table. With this feature, if a query has WHERE
     tab.col1 = 4 and tab.col2 = 9, and there is no multicolumn index
     on col1 and col2, but there is an index on col1 and another on
     col2, it is possible to search both indexes and combine the
     results in memory, then do heap fetches for only the rows
     matching both the col1 and col2 restrictions. This is very useful
     in environments that have a lot of unstructured queries where it
     is impossible to create indexes that match all possible access
     conditions. Bitmap scans are useful even with a single index, as
     they reduce the amount of random access needed; a bitmap index
     scan is efficient for retrieving fairly large fractions of the
     complete table, whereas plain index scans are not.
--
let name="cbbrowne" and tld="cbbrowne.com" in name ^ "@" ^ tld;;
http://cbbrowne.com/info/advocacy.html
A VAX is virtually a computer, but not quite.

Re: bit map indexes in postgres

From
Tom Lane
Date:
Chris Browne <cbbrowne@acm.org> writes:
> bnichols@ca.afilias.info (Brad Nicholson) writes:
>> Bitmap indexs are coming in 8.1 (which is currently in beta).

> It is worth noticing that these are not bitmaps on disk, but rather
> are handled in memory.

Yes.  An on-disk bitmap index is a totally different animal.

There was some work done towards on-disk bitmap indexes this past
summer, but AFAIR it crashed and burned --- no apparent performance
gain.

            regards, tom lane