]> granicus.if.org Git - postgresql/commit
Rewrite btree index scans to work a page at a time in all cases (both
authorTom Lane <tgl@sss.pgh.pa.us>
Sun, 7 May 2006 01:21:30 +0000 (01:21 +0000)
committerTom Lane <tgl@sss.pgh.pa.us>
Sun, 7 May 2006 01:21:30 +0000 (01:21 +0000)
commit09cb5c0e7d6fbc9dee26dc429e4fc0f2a88e5272
tree650b81f13757ed3c99638c65329475e682337646
parent88d94a11bb2b0d3dac95325d8d6056e4bac8b4b8
Rewrite btree index scans to work a page at a time in all cases (both
btgettuple and btgetmulti).  This eliminates the problem of "re-finding" the
exact stopping point, since the stopping point is effectively always a page
boundary, and index items are never moved across pre-existing page boundaries.
A small penalty is that the keys_are_unique optimization is effectively
disabled (and, therefore, is removed in this patch), causing us to apply
_bt_checkkeys() to at least one more tuple than necessary when looking up a
unique key.  However, the advantages for non-unique cases seem great enough to
accept this tradeoff.  Aside from simplifying and (sometimes) speeding up the
indexscan code, this will allow us to reimplement btbulkdelete as a largely
sequential scan instead of index-order traversal, thereby significantly
reducing the cost of VACUUM.  Those changes will come in a separate patch.

Original patch by Heikki Linnakangas, rework by Tom Lane.
src/backend/access/index/genam.c
src/backend/access/index/indexam.c
src/backend/access/nbtree/README
src/backend/access/nbtree/nbtree.c
src/backend/access/nbtree/nbtsearch.c
src/backend/access/nbtree/nbtutils.c
src/include/access/itup.h
src/include/access/nbtree.h
src/include/access/relscan.h