pgsql: Rewrite btree index scans to work a page at a time in all cases

From: tgl(at)postgresql(dot)org (Tom Lane)
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Rewrite btree index scans to work a page at a time in all cases
Date: 2006-05-07 01:21:30
Message-ID: 20060507012130.7778C9FA4DE@postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Log Message:
-----------
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.

Modified Files:
--------------
pgsql/src/backend/access/index:
genam.c (r1.54 -> r1.55)
(http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/access/index/genam.c.diff?r1=1.54&r2=1.55)
indexam.c (r1.92 -> r1.93)
(http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/access/index/indexam.c.diff?r1=1.92&r2=1.93)
pgsql/src/backend/access/nbtree:
README (r1.10 -> r1.11)
(http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/access/nbtree/README.diff?r1=1.10&r2=1.11)
nbtree.c (r1.146 -> r1.147)
(http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/access/nbtree/nbtree.c.diff?r1=1.146&r2=1.147)
nbtsearch.c (r1.104 -> r1.105)
(http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/access/nbtree/nbtsearch.c.diff?r1=1.104&r2=1.105)
nbtutils.c (r1.72 -> r1.73)
(http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/access/nbtree/nbtutils.c.diff?r1=1.72&r2=1.73)
pgsql/src/include/access:
itup.h (r1.45 -> r1.46)
(http://developer.postgresql.org/cvsweb.cgi/pgsql/src/include/access/itup.h.diff?r1=1.45&r2=1.46)
nbtree.h (r1.96 -> r1.97)
(http://developer.postgresql.org/cvsweb.cgi/pgsql/src/include/access/nbtree.h.diff?r1=1.96&r2=1.97)
relscan.h (r1.44 -> r1.45)
(http://developer.postgresql.org/cvsweb.cgi/pgsql/src/include/access/relscan.h.diff?r1=1.44&r2=1.45)

Browse pgsql-committers by date

  From Date Subject
Next Message James William Pye 2006-05-07 14:55:47 python - pkg: Include 'ctl' in package.
Previous Message Bruce Momjian 2006-05-07 01:05:11 pgsql: Use $(LIBS:-lpgport=) rather than $(patsubst -lpgport, , $(LIBS)),