1 /*-------------------------------------------------------------------------
4 * POSTGRES internal relation scan descriptor definitions.
7 * Copyright (c) 1994, Regents of the University of California
9 * $Id: relscan.h,v 1.13 1998/11/27 19:33:31 vadim Exp $
11 *-------------------------------------------------------------------------
16 #include <storage/buf.h>
17 #include <utils/rel.h>
18 #include <access/htup.h>
19 #include <utils/tqual.h>
21 typedef ItemPointerData MarkData;
23 typedef struct HeapScanDescData
25 Relation rs_rd; /* pointer to relation descriptor */
26 HeapTupleData rs_ptup; /* previous tuple in scan */
27 HeapTupleData rs_ctup; /* current tuple in scan */
28 HeapTupleData rs_ntup; /* next tuple in scan */
29 Buffer rs_pbuf; /* previous buffer in scan */
30 Buffer rs_cbuf; /* current buffer in scan */
31 Buffer rs_nbuf; /* next buffer in scan */
32 ItemPointerData rs_mptid; /* marked previous tid */
33 ItemPointerData rs_mctid; /* marked current tid */
34 ItemPointerData rs_mntid; /* marked next tid */
35 ItemPointerData rs_mcd; /* marked current delta XXX ??? */
36 Snapshot rs_snapshot; /* snapshot to see */
37 bool rs_atend; /* restart scan at end? */
38 uint16 rs_cdelta; /* current delta in chain */
39 uint16 rs_nkeys; /* number of attributes in keys */
40 ScanKey rs_key; /* key descriptors */
43 typedef HeapScanDescData *HeapScanDesc;
45 typedef struct IndexScanDescData
47 Relation relation; /* relation descriptor */
48 void *opaque; /* am-specific slot */
49 ItemPointerData previousItemData; /* previous index pointer */
50 ItemPointerData currentItemData; /* current index pointer */
51 ItemPointerData nextItemData; /* next index pointer */
52 MarkData previousMarkData; /* marked previous pointer */
53 MarkData currentMarkData; /* marked current pointer */
54 MarkData nextMarkData; /* marked next pointer */
55 uint8 flags; /* scan position flags */
56 bool scanFromEnd; /* restart scan at end? */
57 uint16 numberOfKeys; /* number of key attributes */
58 ScanKey keyData; /* key descriptor */
61 typedef IndexScanDescData *IndexScanDesc;
64 * IndexScanDescPtr is used in the executor where we have to
65 * keep track of several index scans when using several indices
69 typedef IndexScanDesc *IndexScanDescPtr;
73 * True iff the heap scan is valid.
75 #define HeapScanIsValid(scan) PointerIsValid(scan)
79 * True iff the index scan is valid.
81 #define IndexScanIsValid(scan) PointerIsValid(scan)
83 #endif /* RELSCAN_H */