1996-08-27 23:50:29 +02: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
|
|
|
*
|
|
|
|
*
|
|
|
|
* Copyright (c) 1994, Regents of the University of California
|
|
|
|
*
|
1997-11-21 00:24:03 +01:00
|
|
|
* $Id: relscan.h,v 1.9 1997/11/20 23:23:33 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
|
|
|
|
|
1996-11-04 09:53:07 +01:00
|
|
|
#include <utils/tqual.h>
|
|
|
|
#include <storage/buf.h>
|
|
|
|
#include <utils/rel.h>
|
1996-08-27 23:50:29 +02:00
|
|
|
|
1997-09-07 07:04:48 +02:00
|
|
|
typedef ItemPointerData MarkData;
|
1996-08-27 23:50:29 +02:00
|
|
|
|
1997-09-07 07:04:48 +02:00
|
|
|
typedef struct HeapScanDescData
|
|
|
|
{
|
1997-09-08 04:41:22 +02:00
|
|
|
Relation rs_rd; /* pointer to relation descriptor */
|
|
|
|
HeapTuple rs_ptup; /* previous tuple in scan */
|
|
|
|
HeapTuple rs_ctup; /* current tuple in scan */
|
|
|
|
HeapTuple rs_ntup; /* next tuple in scan */
|
|
|
|
Buffer rs_pbuf; /* previous buffer in scan */
|
|
|
|
Buffer rs_cbuf; /* current buffer in scan */
|
|
|
|
Buffer rs_nbuf; /* next buffer in scan */
|
1997-09-07 07:04:48 +02:00
|
|
|
ItemPointerData rs_mptid; /* marked previous tid */
|
|
|
|
ItemPointerData rs_mctid; /* marked current tid */
|
|
|
|
ItemPointerData rs_mntid; /* marked next tid */
|
|
|
|
ItemPointerData rs_mcd; /* marked current delta XXX ??? */
|
1997-09-08 04:41:22 +02:00
|
|
|
bool rs_atend; /* restart scan at end? */
|
1997-11-21 00:24:03 +01:00
|
|
|
bool rs_seeself; /* see self or not */
|
1997-09-08 04:41:22 +02:00
|
|
|
uint16 rs_cdelta; /* current delta in chain */
|
|
|
|
uint16 rs_nkeys; /* number of attributes in keys */
|
|
|
|
ScanKey rs_key; /* key descriptors */
|
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
|
|
|
|
{
|
1997-09-08 04:41:22 +02:00
|
|
|
Relation relation; /* relation descriptor */
|
|
|
|
void *opaque; /* am-specific slot */
|
1997-09-07 07:04:48 +02:00
|
|
|
ItemPointerData previousItemData; /* previous index pointer */
|
|
|
|
ItemPointerData currentItemData; /* current index pointer */
|
|
|
|
ItemPointerData nextItemData; /* next index pointer */
|
1997-09-08 04:41:22 +02:00
|
|
|
MarkData previousMarkData; /* marked previous pointer */
|
|
|
|
MarkData currentMarkData;/* marked current pointer */
|
|
|
|
MarkData nextMarkData; /* marked next pointer */
|
|
|
|
uint8 flags; /* scan position flags */
|
|
|
|
bool scanFromEnd; /* restart scan at end? */
|
|
|
|
uint16 numberOfKeys; /* number of key attributes */
|
|
|
|
ScanKey keyData; /* key descriptor */
|
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
|
|
|
|
|
|
|
/* ----------------
|
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
|
|
|
|
|
|
|
/*
|
|
|
|
* 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
|
|
|
|
|
|
|
/*
|
|
|
|
* 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)
|
|
|
|
|
1997-09-07 07:04:48 +02:00
|
|
|
#endif /* RELSCAN_H */
|