1
0
mirror of https://github.com/postgres/postgres.git synced 2025-10-25 13:17:41 +03:00

Fix for bug #866. 7.3 contains new logic for avoiding redundant calls to

the index AM when we know we are fetching a unique row.  However, this
logic did not consider the possibility that it would be asked to fetch
backwards.  Also fix mark/restore to work correctly in this scenario.
This commit is contained in:
Tom Lane
2003-01-08 19:41:40 +00:00
parent 9270f1cdaa
commit cbca6c4896
3 changed files with 58 additions and 11 deletions

View File

@@ -7,7 +7,7 @@
* Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* $Id: relscan.h,v 1.29 2002/09/04 20:31:37 momjian Exp $
* $Id: relscan.h,v 1.30 2003/01/08 19:41:40 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -70,6 +70,15 @@ typedef struct IndexScanDescData
FmgrInfo fn_getnext; /* cached lookup info for AM's getnext fn */
/*
* If keys_are_unique and got_tuple are both true, we stop calling the
* index AM; it is then necessary for index_getnext to keep track of
* the logical scan position for itself. It does that using
* unique_tuple_pos: -1 = before row, 0 = on row, +1 = after row.
*/
int unique_tuple_pos; /* logical position */
int unique_tuple_mark; /* logical marked position */
PgStat_Info xs_pgstat_info; /* statistics collector hook */
} IndexScanDescData;