Replace "amgetmulti" AM functions with "amgetbitmap", in which the whole
authorTom Lane <tgl@sss.pgh.pa.us>
Thu, 10 Apr 2008 22:25:26 +0000 (22:25 +0000)
committerTom Lane <tgl@sss.pgh.pa.us>
Thu, 10 Apr 2008 22:25:26 +0000 (22:25 +0000)
commitd4cc2affb8c960fbac54d13ea1ccce0f0d68fca8
treec642998208cff153222a9428aaba5800d7e93bc9
parent050f758a391d26f46290ca2d17b13ceb21be7e1c
Replace "amgetmulti" AM functions with "amgetbitmap", in which the whole
indexscan always occurs in one call, and the results are returned in a
TIDBitmap instead of a limited-size array of TIDs.  This should improve
speed a little by reducing AM entry/exit overhead, and it is necessary
infrastructure if we are ever to support bitmap indexes.

In an only slightly related change, add support for TIDBitmaps to preserve
(somewhat lossily) the knowledge that particular TIDs reported by an index
need to have their quals rechecked when the heap is visited.  This facility
is not really used yet; we'll need to extend the forced-recheck feature to
plain indexscans before it's useful, and that hasn't been coded yet.
The intent is to use it to clean up 8.3's horrid @@@ kluge for text search
with weighted queries.  There might be other uses in future, but that one
alone is sufficient reason.

Heikki Linnakangas, with some adjustments by me.
30 files changed:
doc/src/sgml/catalogs.sgml
doc/src/sgml/indexam.sgml
src/backend/access/gin/ginget.c
src/backend/access/gist/gistget.c
src/backend/access/hash/hash.c
src/backend/access/index/genam.c
src/backend/access/index/indexam.c
src/backend/access/nbtree/nbtree.c
src/backend/executor/nodeBitmapHeapscan.c
src/backend/executor/nodeBitmapIndexscan.c
src/backend/nodes/tidbitmap.c
src/include/access/genam.h
src/include/access/gin.h
src/include/access/gist_private.h
src/include/access/hash.h
src/include/access/nbtree.h
src/include/access/relscan.h
src/include/catalog/catversion.h
src/include/catalog/pg_am.h
src/include/catalog/pg_proc.h
src/include/nodes/tidbitmap.h
src/include/utils/rel.h
src/test/regress/expected/bitmapops.out [new file with mode: 0644]
src/test/regress/expected/create_index.out
src/test/regress/expected/oidjoins.out
src/test/regress/parallel_schedule
src/test/regress/serial_schedule
src/test/regress/sql/bitmapops.sql [new file with mode: 0644]
src/test/regress/sql/create_index.sql
src/test/regress/sql/oidjoins.sql