1996-07-09 08:22:35 +02:00
|
|
|
/*-------------------------------------------------------------------------
|
|
|
|
*
|
|
|
|
* tuptable.h--
|
1997-09-07 07:04:48 +02:00
|
|
|
* tuple table support stuff
|
1996-07-09 08:22:35 +02:00
|
|
|
*
|
|
|
|
*
|
|
|
|
* Copyright (c) 1994, Regents of the University of California
|
|
|
|
*
|
1997-09-07 07:04:48 +02:00
|
|
|
* $Id: tuptable.h,v 1.5 1997/09/07 04:58:03 momjian Exp $
|
1996-07-09 08:22:35 +02:00
|
|
|
*
|
|
|
|
* NOTES
|
1997-09-07 07:04:48 +02:00
|
|
|
* The tuple table interface is getting pretty ugly.
|
|
|
|
* It should be redesigned soon.
|
1996-07-09 08:22:35 +02:00
|
|
|
*
|
|
|
|
*-------------------------------------------------------------------------
|
|
|
|
*/
|
|
|
|
#ifndef TUPTABLE_H
|
|
|
|
#define TUPTABLE_H
|
|
|
|
|
1996-11-04 09:53:07 +01:00
|
|
|
#include <storage/buf.h>
|
|
|
|
#include <access/tupdesc.h>
|
|
|
|
#include <access/htup.h>
|
1996-10-23 09:42:13 +02:00
|
|
|
|
1996-07-09 08:22:35 +02:00
|
|
|
/* ----------------
|
1997-09-07 07:04:48 +02:00
|
|
|
* Note: the executor tuple table is managed and manipulated by special
|
|
|
|
* code and macros in executor/execTuples.c and tupTable.h
|
1996-07-09 08:22:35 +02:00
|
|
|
*
|
1997-09-07 07:04:48 +02:00
|
|
|
* TupleTableSlot information
|
1996-07-09 08:22:35 +02:00
|
|
|
*
|
1997-09-07 07:04:48 +02:00
|
|
|
* shouldFree boolean - should we call pfree() on tuple
|
|
|
|
* descIsNew boolean - true when tupleDescriptor changes
|
|
|
|
* tupleDescriptor type information kept regarding the tuple data
|
|
|
|
* buffer the buffer for tuples pointing to disk pages
|
1996-07-09 08:22:35 +02:00
|
|
|
*
|
1997-09-07 07:04:48 +02:00
|
|
|
* The executor stores pointers to tuples in a ``tuple table''
|
|
|
|
* which is composed of TupleTableSlot's. Some of the tuples
|
|
|
|
* are pointers to buffer pages and others are pointers to
|
|
|
|
* palloc'ed memory and the shouldFree variable tells us when
|
|
|
|
* we may call pfree() on a tuple. -cim 9/23/90
|
1996-07-09 08:22:35 +02:00
|
|
|
*
|
1997-09-07 07:04:48 +02:00
|
|
|
* In the implementation of nested-dot queries such as
|
|
|
|
* "retrieve (EMP.hobbies.all)", a single scan may return tuples
|
|
|
|
* of many types, so now we return pointers to tuple descriptors
|
|
|
|
* along with tuples returned via the tuple table. -cim 1/18/90
|
1996-07-09 08:22:35 +02:00
|
|
|
* ----------------
|
|
|
|
*/
|
1997-09-07 07:04:48 +02:00
|
|
|
typedef struct TupleTableSlot
|
|
|
|
{
|
|
|
|
NodeTag type;
|
|
|
|
HeapTuple val;
|
|
|
|
bool ttc_shouldFree;
|
|
|
|
bool ttc_descIsNew;
|
|
|
|
TupleDesc ttc_tupleDescriptor;
|
|
|
|
Buffer ttc_buffer;
|
|
|
|
int ttc_whichplan;
|
|
|
|
} TupleTableSlot;
|
1996-07-09 08:22:35 +02:00
|
|
|
|
|
|
|
/* ----------------
|
1997-09-07 07:04:48 +02:00
|
|
|
* tuple table data structure
|
1996-07-09 08:22:35 +02:00
|
|
|
* ----------------
|
|
|
|
*/
|
1997-09-07 07:04:48 +02:00
|
|
|
typedef struct TupleTableData
|
|
|
|
{
|
|
|
|
int size; /* size of the table */
|
|
|
|
int next; /* next available slot number */
|
|
|
|
TupleTableSlot *array; /* array of TupleTableSlot's */
|
|
|
|
} TupleTableData;
|
1996-07-09 08:22:35 +02:00
|
|
|
|
|
|
|
typedef TupleTableData *TupleTable;
|
|
|
|
|
1997-09-07 07:04:48 +02:00
|
|
|
/*
|
1996-07-09 08:22:35 +02:00
|
|
|
tuple table macros are all excised from the system now
|
|
|
|
see executor.h for decls of functions defined in execTuples.c
|
|
|
|
|
|
|
|
- jolly
|
|
|
|
*/
|
|
|
|
|
1997-09-07 07:04:48 +02:00
|
|
|
#endif /* TUPTABLE_H */
|