diff options
| author | Tom Lane | 2008-04-13 19:18:14 +0000 |
|---|---|---|
| committer | Tom Lane | 2008-04-13 19:18:14 +0000 |
| commit | 24558da14a26337e945732d3b435b07edcbb6733 (patch) | |
| tree | 7a6fbd12b1793e46d4584f49a1bc9373300125d8 /src/backend/access/index/indexam.c | |
| parent | c22ed3d523782c43836c163c16fa5a7bb3912826 (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/backend/access/index/indexam.c')
| -rw-r--r-- | src/backend/access/index/indexam.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/backend/access/index/indexam.c b/src/backend/access/index/indexam.c index 7a06d0074e8..ece3ae8ea40 100644 --- a/src/backend/access/index/indexam.c +++ b/src/backend/access/index/indexam.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/access/index/indexam.c,v 1.106 2008/04/12 23:14:21 tgl Exp $ + * $PostgreSQL: pgsql/src/backend/access/index/indexam.c,v 1.107 2008/04/13 19:18:14 tgl Exp $ * * INTERFACE ROUTINES * index_open - open an index relation by relation OID @@ -402,6 +402,10 @@ index_restrpos(IndexScanDesc scan) * snapshot, or NULL if no more matching tuples exist. On success, * the buffer containing the heap tuple is pinned (the pin will be dropped * at the next index_getnext or index_endscan). + * + * Note: caller must check scan->xs_recheck, and perform rechecking of the + * scan keys if required. We do not do that here because we don't have + * enough information to do it efficiently in the general case. * ---------------- */ HeapTuple @@ -455,6 +459,8 @@ index_getnext(IndexScanDesc scan, ScanDirection direction) /* * The AM's gettuple proc finds the next index entry matching the * scan keys, and puts the TID in xs_ctup.t_self (ie, *tid). + * It should also set scan->xs_recheck, though we pay no + * attention to that here. */ found = DatumGetBool(FunctionCall2(procedure, PointerGetDatum(scan), |
