Bitmap index - first look - Mailing list pgsql-hackers

From Teodor Sigaev
Subject Bitmap index - first look
Date
Msg-id 49130E72.1000803@sigaev.ru
Whole thread Raw
Responses Re: Bitmap index - first look  ("Vladimir Sitnikov" <sitnikov.vladimir@gmail.com>)
Re: Bitmap index - first look  (Teodor Sigaev <teodor@sigaev.ru>)
List pgsql-hackers
http://archives.postgresql.org/message-id/20081101000154.GO27872@fune

1) Sometimes index doesn't find all matching rows:
postgres=# SELECT * FROM qq WHERE t ='asd'; i |  t
---+----- 2 | asd 1 | asd 2 | asd
(3 rows)
postgres=# SET enable_seqscan=off;
SET
postgres=# SELECT * FROM qq WHERE t ='asd'; i |  t
---+----- 2 | asd
(1 row)

How to reproduce:
DROP TABLE IF EXISTS qq;
CREATE TABLE qq ( i int, t text );
INSERT INTO qq VALUES (1, 'qwe');
INSERT INTO qq VALUES (2, 'asd');
CREATE INDEX qqidx ON qq USING bitmap (i,t);
INSERT INTO qq VALUES (1, 'asd');
INSERT INTO qq VALUES (2, 'asd');
SELECT * FROM qq;
SELECT * FROM qq WHERE t ='asd';
SET enable_seqscan=off;
SELECT * FROM qq WHERE t ='asd';

2) Why is pg_am.amstrategies set to 5 while index supports only equal operation?

3) Typo in bmbulkdelete:    /* allocate stats if first time through, else re-use existing struct */    if (result ==
NULL)         result = (IndexBulkDeleteResult *)                  palloc0(sizeof(IndexBulkDeleteResult));
 
    result = (IndexBulkDeleteResult *) palloc0(sizeof(IndexBulkDeleteResult));
    'result' is allocated twice.

4) Bitmap index is marked with pg_am.amcanorder = 'f', so you don't need to 
support ammarkpos/amrestrpos - see
http://archives.postgresql.org/pgsql-hackers/2008-10/msg00862.php




-- 
Teodor Sigaev                                   E-mail: teodor@sigaev.ru
  WWW: http://www.sigaev.ru/
 


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Timing problem in DROP TABLESPACE?
Next
From: "Tony Fernandez"
Date:
Subject: Upgrading Postgres versions question