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/