diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2004-06-04 20:35:21 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2004-06-04 20:35:21 +0000 |
commit | 8f2ea8b7b53a02078ba0393e6892ac5356a3631e (patch) | |
tree | 536f02e4a6eec0304d76688d65cffbcea9679c9b /src/include/access/heapam.h | |
parent | af44cac6ef46e225ae963c5e1f9e2e91a0112e04 (diff) |
Resurrect heap_deformtuple(), this time implemented as a singly nested
loop over the fields instead of a loop around heap_getattr. This is
considerably faster (O(N) instead of O(N^2)) when there are nulls or
varlena fields, since those prevent use of attcacheoff. Replace loops
over heap_getattr with heap_deformtuple in situations where all or most
of the fields have to be fetched, such as printtup and tuptoaster.
Profiling done more than a year ago shows that this should be a nice
win for situations involving many-column tables.
Diffstat (limited to 'src/include/access/heapam.h')
-rw-r--r-- | src/include/access/heapam.h | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/src/include/access/heapam.h b/src/include/access/heapam.h index 9f138524155..5fa50d28e1e 100644 --- a/src/include/access/heapam.h +++ b/src/include/access/heapam.h @@ -7,7 +7,7 @@ * Portions Copyright (c) 1996-2003, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $PostgreSQL: pgsql/src/include/access/heapam.h,v 1.89 2004/04/21 18:24:26 tgl Exp $ + * $PostgreSQL: pgsql/src/include/access/heapam.h,v 1.90 2004/06/04 20:35:21 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -184,9 +184,9 @@ extern XLogRecPtr log_heap_move(Relation reln, Buffer oldbuf, Buffer newbuf, HeapTuple newtup); /* in common/heaptuple.c */ -extern Size ComputeDataSize(TupleDesc tupleDesc, Datum *value, char *nulls); +extern Size ComputeDataSize(TupleDesc tupleDesc, Datum *values, char *nulls); extern void DataFill(char *data, TupleDesc tupleDesc, - Datum *value, char *nulls, uint16 *infomask, + Datum *values, char *nulls, uint16 *infomask, bits8 *bit); extern int heap_attisnull(HeapTuple tup, int attnum); extern Datum nocachegetattr(HeapTuple tup, int attnum, @@ -194,9 +194,14 @@ extern Datum nocachegetattr(HeapTuple tup, int attnum, extern HeapTuple heap_copytuple(HeapTuple tuple); extern void heap_copytuple_with_tuple(HeapTuple src, HeapTuple dest); extern HeapTuple heap_formtuple(TupleDesc tupleDescriptor, - Datum *value, char *nulls); + Datum *values, char *nulls); extern HeapTuple heap_modifytuple(HeapTuple tuple, - Relation relation, Datum *replValue, char *replNull, char *repl); + Relation relation, + Datum *replValues, + char *replNulls, + char *replActions); +extern void heap_deformtuple(HeapTuple tuple, TupleDesc tupleDesc, + Datum *values, char *nulls); extern void heap_freetuple(HeapTuple tuple); extern HeapTuple heap_addheader(int natts, bool withoid, Size structlen, void *structure); |