]> granicus.if.org Git - postgresql/blob - src/include/access/relscan.h
More include file cleanups
[postgresql] / src / include / access / relscan.h
1 /*-------------------------------------------------------------------------
2  *
3  * relscan.h--
4  *    POSTGRES internal relation scan descriptor definitions.
5  *
6  *
7  * Copyright (c) 1994, Regents of the University of California
8  *
9  * $Id: relscan.h,v 1.4 1996/11/03 08:17:22 scrappy Exp $
10  *
11  *-------------------------------------------------------------------------
12  */
13 #ifndef RELSCAN_H
14 #define RELSCAN_H
15
16 #include "utils/rel.h"
17 #include "utils/tqual.h" 
18 #include "storage/buf.h" 
19
20 typedef ItemPointerData MarkData;
21
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 */
39 } HeapScanDescData;
40
41 typedef HeapScanDescData *HeapScanDesc;
42
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 */
56 } IndexScanDescData;
57
58 typedef IndexScanDescData       *IndexScanDesc;
59
60 /* ----------------
61  *      IndexScanDescPtr is used in the executor where we have to
62  *      keep track of several index scans when using several indices
63  *      - cim 9/10/89
64  * ----------------
65  */
66 typedef IndexScanDesc           *IndexScanDescPtr;
67
68 /*
69  * HeapScanIsValid --
70  *      True iff the heap scan is valid.
71  */
72 #define HeapScanIsValid(scan) PointerIsValid(scan)
73
74 /*
75  * IndexScanIsValid --
76  *      True iff the index scan is valid.
77  */
78 #define IndexScanIsValid(scan) PointerIsValid(scan)
79
80 #endif  /* RELSCAN_H */