diff options
| author | Tom Lane <tgl@sss.pgh.pa.us> | 2002-05-24 18:57:57 +0000 |
|---|---|---|
| committer | Tom Lane <tgl@sss.pgh.pa.us> | 2002-05-24 18:57:57 +0000 |
| commit | 3f4d48802271126b1343289a9d2267ff1ed3788a (patch) | |
| tree | b8c7507719ba240834e28cfbb56e2badff118b7e /src/include/access/relscan.h | |
| parent | 2f2d05763d1c55c7998c0d7030659e3db6f60183 (diff) | |
| download | postgresql-3f4d48802271126b1343289a9d2267ff1ed3788a.tar.gz | |
Mark index entries "killed" when they are no longer visible to any
transaction, so as to avoid returning them out of the index AM. Saves
repeated heap_fetch operations on frequently-updated rows. Also detect
queries on unique keys (equality to all columns of a unique index), and
don't bother continuing scan once we have found first match.
Killing is implemented in the btree and hash AMs, but not yet in rtree
or gist, because there isn't an equally convenient place to do it in
those AMs (the outer amgetnext routine can't do it without re-pinning
the index page).
Did some small cleanup on APIs of HeapTupleSatisfies, heap_fetch, and
index_insert to make this a little easier.
Diffstat (limited to 'src/include/access/relscan.h')
| -rw-r--r-- | src/include/access/relscan.h | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/include/access/relscan.h b/src/include/access/relscan.h index 87e3b52369..e23681876d 100644 --- a/src/include/access/relscan.h +++ b/src/include/access/relscan.h @@ -7,7 +7,7 @@ * Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $Id: relscan.h,v 1.26 2002/05/20 23:51:43 tgl Exp $ + * $Id: relscan.h,v 1.27 2002/05/24 18:57:56 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -46,7 +46,15 @@ typedef struct IndexScanDescData int numberOfKeys; /* number of scan keys */ ScanKey keyData; /* array of scan key descriptors */ + /* signaling to index AM about killing index tuples */ + bool kill_prior_tuple; /* last-returned tuple is dead */ + bool ignore_killed_tuples; /* do not return killed entries */ + + /* set by index AM if scan keys satisfy index's uniqueness constraint */ + bool keys_are_unique; + /* scan current state */ + bool got_tuple; /* true after successful index_getnext */ void *opaque; /* access-method-specific info */ ItemPointerData currentItemData; /* current index pointer */ ItemPointerData currentMarkData; /* marked position, if any */ |
