1 /*-------------------------------------------------------------------------
4 * POSTGRES internal relation scan descriptor definitions.
7 * Copyright (c) 1994, Regents of the University of California
9 * $Id: relscan.h,v 1.4 1996/11/03 08:17:22 scrappy Exp $
11 *-------------------------------------------------------------------------
16 #include "utils/rel.h"
17 #include "utils/tqual.h"
18 #include "storage/buf.h"
20 typedef ItemPointerData MarkData;
22 typedef struct HeapScanDescData {
23 Relation rs_rd; /* pointer to relation descriptor */
24 HeapTuple rs_ptup; /* previous tuple in scan */
25 HeapTuple rs_ctup; /* current tuple in scan */
26 HeapTuple rs_ntup; /* next tuple in scan */
27 Buffer rs_pbuf; /* previous buffer in scan */
28 Buffer rs_cbuf; /* current buffer in scan */
29 Buffer rs_nbuf; /* next buffer in scan */
30 ItemPointerData rs_mptid; /* marked previous tid */
31 ItemPointerData rs_mctid; /* marked current tid */
32 ItemPointerData rs_mntid; /* marked next tid */
33 ItemPointerData rs_mcd; /* marked current delta XXX ??? */
34 bool rs_atend; /* restart scan at end? */
35 TimeQual rs_tr; /* time qualification */
36 uint16 rs_cdelta; /* current delta in chain */
37 uint16 rs_nkeys; /* number of attributes in keys */
38 ScanKey rs_key; /* key descriptors */
41 typedef HeapScanDescData *HeapScanDesc;
43 typedef struct IndexScanDescData {
44 Relation relation; /* relation descriptor */
45 void *opaque; /* am-specific slot */
46 ItemPointerData previousItemData; /* previous index pointer */
47 ItemPointerData currentItemData; /* current index pointer */
48 ItemPointerData nextItemData; /* next index pointer */
49 MarkData previousMarkData; /* marked previous pointer */
50 MarkData currentMarkData; /* marked current pointer */
51 MarkData nextMarkData; /* marked next pointer */
52 uint8 flags; /* scan position flags */
53 bool scanFromEnd; /* restart scan at end? */
54 uint16 numberOfKeys; /* number of key attributes */
55 ScanKey keyData; /* key descriptor */
58 typedef IndexScanDescData *IndexScanDesc;
61 * IndexScanDescPtr is used in the executor where we have to
62 * keep track of several index scans when using several indices
66 typedef IndexScanDesc *IndexScanDescPtr;
70 * True iff the heap scan is valid.
72 #define HeapScanIsValid(scan) PointerIsValid(scan)
76 * True iff the index scan is valid.
78 #define IndexScanIsValid(scan) PointerIsValid(scan)
80 #endif /* RELSCAN_H */