mirror of
https://github.com/postgres/postgres.git
synced 2025-10-25 13:17:41 +03:00
Avoid O(N^2) overhead in repeated nocachegetattr calls when columns of
a tuple are being accessed via ExecEvalVar and the attcacheoff shortcut isn't usable (due to nulls and/or varlena columns). To do this, cache Datums extracted from a tuple in the associated TupleTableSlot. Also some code cleanup in and around the TupleTable handling. Atsushi Ogawa with some kibitzing by Tom Lane.
This commit is contained in:
@@ -7,7 +7,7 @@
|
||||
* Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group
|
||||
* Portions Copyright (c) 1994, Regents of the University of California
|
||||
*
|
||||
* $PostgreSQL: pgsql/src/include/access/heapam.h,v 1.94 2005/01/27 23:24:11 neilc Exp $
|
||||
* $PostgreSQL: pgsql/src/include/access/heapam.h,v 1.95 2005/03/14 04:41:13 tgl Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -40,9 +40,6 @@
|
||||
* ----------------
|
||||
*/
|
||||
|
||||
extern Datum nocachegetattr(HeapTuple tup, int attnum,
|
||||
TupleDesc att, bool *isnull);
|
||||
|
||||
#if !defined(DISABLE_COMPLEX_MACRO)
|
||||
|
||||
#define fastgetattr(tup, attnum, tupleDesc, isnull) \
|
||||
@@ -115,9 +112,6 @@ extern Datum fastgetattr(HeapTuple tup, int attnum, TupleDesc tupleDesc,
|
||||
) \
|
||||
)
|
||||
|
||||
extern Datum heap_getsysattr(HeapTuple tup, int attnum, TupleDesc tupleDesc,
|
||||
bool *isnull);
|
||||
|
||||
|
||||
/* ----------------
|
||||
* function prototypes for heap access method
|
||||
@@ -191,6 +185,8 @@ extern void DataFill(char *data, TupleDesc tupleDesc,
|
||||
extern int heap_attisnull(HeapTuple tup, int attnum);
|
||||
extern Datum nocachegetattr(HeapTuple tup, int attnum,
|
||||
TupleDesc att, bool *isnull);
|
||||
extern Datum heap_getsysattr(HeapTuple tup, int attnum, TupleDesc tupleDesc,
|
||||
bool *isnull);
|
||||
extern HeapTuple heap_copytuple(HeapTuple tuple);
|
||||
extern void heap_copytuple_with_tuple(HeapTuple src, HeapTuple dest);
|
||||
extern HeapTuple heap_formtuple(TupleDesc tupleDescriptor,
|
||||
|
||||
Reference in New Issue
Block a user