]> granicus.if.org Git - postgresql/blob - src/include/access/relscan.h
Remove tqual.h includes not needed.
[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.10 1997/11/24 05:09:39 momjian Exp $
10  *
11  *-------------------------------------------------------------------------
12  */
13 #ifndef RELSCAN_H
14 #define RELSCAN_H
15
16 #include <storage/buf.h>
17 #include <utils/rel.h>
18 #include <access/htup.h>
19
20 typedef ItemPointerData MarkData;
21
22 typedef struct HeapScanDescData
23 {
24         Relation        rs_rd;                  /* pointer to relation descriptor */
25         HeapTuple       rs_ptup;                /* previous tuple in scan */
26         HeapTuple       rs_ctup;                /* current tuple in scan */
27         HeapTuple       rs_ntup;                /* next tuple in scan */
28         Buffer          rs_pbuf;                /* previous buffer in scan */
29         Buffer          rs_cbuf;                /* current buffer in scan */
30         Buffer          rs_nbuf;                /* next buffer in scan */
31         ItemPointerData rs_mptid;       /* marked previous tid */
32         ItemPointerData rs_mctid;       /* marked current tid */
33         ItemPointerData rs_mntid;       /* marked next tid */
34         ItemPointerData rs_mcd;         /* marked current delta XXX ??? */
35         bool            rs_atend;               /* restart scan at end? */
36         bool            rs_seeself;             /* see self or not */
37         uint16          rs_cdelta;              /* current delta in chain */
38         uint16          rs_nkeys;               /* number of attributes in keys */
39         ScanKey         rs_key;                 /* key descriptors */
40 } HeapScanDescData;
41
42 typedef HeapScanDescData *HeapScanDesc;
43
44 typedef struct IndexScanDescData
45 {
46         Relation        relation;               /* relation descriptor */
47         void       *opaque;                     /* am-specific slot */
48         ItemPointerData previousItemData;       /* previous index pointer */
49         ItemPointerData currentItemData;        /* current index pointer */
50         ItemPointerData nextItemData;           /* next index pointer */
51         MarkData        previousMarkData;               /* marked previous pointer */
52         MarkData        currentMarkData;/* marked current  pointer */
53         MarkData        nextMarkData;   /* marked next pointer */
54         uint8           flags;                  /* scan position flags */
55         bool            scanFromEnd;    /* restart scan at end? */
56         uint16          numberOfKeys;   /* number of key attributes */
57         ScanKey         keyData;                /* key descriptor */
58 } IndexScanDescData;
59
60 typedef IndexScanDescData *IndexScanDesc;
61
62 /* ----------------
63  *              IndexScanDescPtr is used in the executor where we have to
64  *              keep track of several index scans when using several indices
65  *              - cim 9/10/89
66  * ----------------
67  */
68 typedef IndexScanDesc *IndexScanDescPtr;
69
70 /*
71  * HeapScanIsValid --
72  *              True iff the heap scan is valid.
73  */
74 #define HeapScanIsValid(scan) PointerIsValid(scan)
75
76 /*
77  * IndexScanIsValid --
78  *              True iff the index scan is valid.
79  */
80 #define IndexScanIsValid(scan) PointerIsValid(scan)
81
82 #endif                                                  /* RELSCAN_H */