summaryrefslogtreecommitdiff
path: root/src/include/access
diff options
context:
space:
mode:
authorTom Lane2008-04-13 19:18:14 +0000
committerTom Lane2008-04-13 19:18:14 +0000
commit24558da14a26337e945732d3b435b07edcbb6733 (patch)
tree7a6fbd12b1793e46d4584f49a1bc9373300125d8 /src/include/access
parentc22ed3d523782c43836c163c16fa5a7bb3912826 (diff)
Phase 2 of project to make index operator lossiness be determined at runtime
instead of plan time. Extend the amgettuple API so that the index AM returns a boolean indicating whether the indexquals need to be rechecked, and make that rechecking happen in nodeIndexscan.c (currently the only place where it's expected to be needed; other callers of index_getnext are just erroring out for now). For the moment, GIN and GIST have stub logic that just always sets the recheck flag to TRUE --- I'm hoping to get Teodor to handle pushing that control down to the opclass consistent() functions. The planner no longer pays any attention to amopreqcheck, and that catalog column will go away in due course.
Diffstat (limited to 'src/include/access')
-rw-r--r--src/include/access/relscan.h9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/include/access/relscan.h b/src/include/access/relscan.h
index 637b363f528..cf8f8a0c4df 100644
--- a/src/include/access/relscan.h
+++ b/src/include/access/relscan.h
@@ -7,7 +7,7 @@
* Portions Copyright (c) 1996-2008, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $PostgreSQL: pgsql/src/include/access/relscan.h,v 1.63 2008/04/12 23:14:21 tgl Exp $
+ * $PostgreSQL: pgsql/src/include/access/relscan.h,v 1.64 2008/04/13 19:18:14 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -76,15 +76,16 @@ typedef struct IndexScanDescData
/* index access method's private state */
void *opaque; /* access-method-specific info */
- /* xs_ctup/xs_cbuf are valid after a successful index_getnext */
+ /* xs_ctup/xs_cbuf/xs_recheck are valid after a successful index_getnext */
HeapTupleData xs_ctup; /* current heap tuple, if any */
Buffer xs_cbuf; /* current heap buffer in scan, if any */
/* NB: if xs_cbuf is not InvalidBuffer, we hold a pin on that buffer */
+ bool xs_recheck; /* T means scan keys must be rechecked */
/* state data for traversing HOT chains in index_getnext */
- TransactionId xs_prev_xmax; /* previous HOT chain member's XMAX, if any */
- OffsetNumber xs_next_hot; /* next member of HOT chain, if any */
bool xs_hot_dead; /* T if all members of HOT chain are dead */
+ OffsetNumber xs_next_hot; /* next member of HOT chain, if any */
+ TransactionId xs_prev_xmax; /* previous HOT chain member's XMAX, if any */
} IndexScanDescData;
typedef IndexScanDescData *IndexScanDesc;