1996-08-27 23:50:29 +02:00
|
|
|
/*-------------------------------------------------------------------------
|
|
|
|
*
|
1999-02-14 00:22:53 +01:00
|
|
|
* relscan.h
|
1997-09-07 07:04:48 +02:00
|
|
|
* POSTGRES internal relation scan descriptor definitions.
|
1996-08-27 23:50:29 +02:00
|
|
|
*
|
|
|
|
*
|
2001-01-24 20:43:33 +01:00
|
|
|
* Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group
|
2000-01-26 06:58:53 +01:00
|
|
|
* Portions Copyright (c) 1994, Regents of the University of California
|
1996-08-27 23:50:29 +02:00
|
|
|
*
|
2001-10-28 07:26:15 +01:00
|
|
|
* $Id: relscan.h,v 1.24 2001/10/28 06:25:59 momjian Exp $
|
1996-08-27 23:50:29 +02:00
|
|
|
*
|
|
|
|
*-------------------------------------------------------------------------
|
|
|
|
*/
|
1997-09-07 07:04:48 +02:00
|
|
|
#ifndef RELSCAN_H
|
1996-08-27 23:50:29 +02:00
|
|
|
#define RELSCAN_H
|
|
|
|
|
1999-07-16 01:04:24 +02:00
|
|
|
#include "utils/tqual.h"
|
1996-08-27 23:50:29 +02:00
|
|
|
|
|
|
|
|
1997-09-07 07:04:48 +02:00
|
|
|
typedef struct HeapScanDescData
|
|
|
|
{
|
1999-05-25 18:15:34 +02:00
|
|
|
Relation rs_rd; /* pointer to relation descriptor */
|
2001-06-09 20:16:59 +02:00
|
|
|
HeapTupleData rs_ctup; /* current tuple in scan, if any */
|
|
|
|
Buffer rs_cbuf; /* current buffer in scan, if any */
|
|
|
|
/* NB: if rs_cbuf is not InvalidBuffer, we hold a pin on that buffer */
|
|
|
|
ItemPointerData rs_mctid; /* marked tid, if any */
|
1999-05-25 18:15:34 +02:00
|
|
|
Snapshot rs_snapshot; /* snapshot to see */
|
2001-06-09 20:16:59 +02:00
|
|
|
uint16 rs_nkeys; /* number of scan keys to select tuples */
|
1999-05-25 18:15:34 +02:00
|
|
|
ScanKey rs_key; /* key descriptors */
|
2001-06-22 21:16:24 +02:00
|
|
|
|
2001-10-25 07:50:21 +02:00
|
|
|
PgStat_Info rs_pgstat_info; /* statistics collector hook */
|
1997-09-08 23:56:23 +02:00
|
|
|
} HeapScanDescData;
|
1996-08-27 23:50:29 +02:00
|
|
|
|
|
|
|
typedef HeapScanDescData *HeapScanDesc;
|
|
|
|
|
1997-09-07 07:04:48 +02:00
|
|
|
typedef struct IndexScanDescData
|
|
|
|
{
|
1999-05-25 18:15:34 +02:00
|
|
|
Relation relation; /* relation descriptor */
|
2001-06-09 20:16:59 +02:00
|
|
|
void *opaque; /* access-method-specific info */
|
1997-09-07 07:04:48 +02:00
|
|
|
ItemPointerData currentItemData; /* current index pointer */
|
2001-10-25 07:50:21 +02:00
|
|
|
ItemPointerData currentMarkData; /* marked current pointer */
|
1999-05-25 18:15:34 +02:00
|
|
|
uint8 flags; /* scan position flags */
|
|
|
|
bool scanFromEnd; /* restart scan at end? */
|
2001-06-09 20:16:59 +02:00
|
|
|
uint16 numberOfKeys; /* number of scan keys to select tuples */
|
|
|
|
ScanKey keyData; /* key descriptors */
|
2000-03-15 00:52:01 +01:00
|
|
|
FmgrInfo fn_getnext; /* cached lookup info for am's getnext fn */
|
2001-06-22 21:16:24 +02:00
|
|
|
|
2001-10-25 07:50:21 +02:00
|
|
|
PgStat_Info xs_pgstat_info; /* statistics collector hook */
|
1997-09-08 23:56:23 +02:00
|
|
|
} IndexScanDescData;
|
1996-08-27 23:50:29 +02:00
|
|
|
|
1997-09-07 07:04:48 +02:00
|
|
|
typedef IndexScanDescData *IndexScanDesc;
|
1996-08-27 23:50:29 +02:00
|
|
|
|
2001-06-09 20:16:59 +02:00
|
|
|
/* IndexScanDesc flag bits (none of these are actually used currently) */
|
|
|
|
#define ScanUnmarked 0x01
|
|
|
|
#define ScanUncheckedPrevious 0x02
|
|
|
|
#define ScanUncheckedNext 0x04
|
|
|
|
|
|
|
|
|
1996-08-27 23:50:29 +02:00
|
|
|
/* ----------------
|
1997-09-07 07:04:48 +02:00
|
|
|
* IndexScanDescPtr is used in the executor where we have to
|
|
|
|
* keep track of several index scans when using several indices
|
|
|
|
* - cim 9/10/89
|
1996-08-27 23:50:29 +02:00
|
|
|
* ----------------
|
|
|
|
*/
|
1997-09-07 07:04:48 +02:00
|
|
|
typedef IndexScanDesc *IndexScanDescPtr;
|
1996-08-27 23:50:29 +02:00
|
|
|
|
|
|
|
/*
|
1999-05-25 18:15:34 +02:00
|
|
|
* HeapScanIsValid
|
1997-09-07 07:04:48 +02:00
|
|
|
* True iff the heap scan is valid.
|
1996-08-27 23:50:29 +02:00
|
|
|
*/
|
1997-09-07 07:04:48 +02:00
|
|
|
#define HeapScanIsValid(scan) PointerIsValid(scan)
|
1996-08-27 23:50:29 +02:00
|
|
|
|
|
|
|
/*
|
1999-05-25 18:15:34 +02:00
|
|
|
* IndexScanIsValid
|
1997-09-07 07:04:48 +02:00
|
|
|
* True iff the index scan is valid.
|
1996-08-27 23:50:29 +02:00
|
|
|
*/
|
|
|
|
#define IndexScanIsValid(scan) PointerIsValid(scan)
|
2001-10-28 07:26:15 +01:00
|
|
|
|
1998-09-01 06:40:42 +02:00
|
|
|
#endif /* RELSCAN_H */
|