From 1f5cc8c78aa3e600f3857f39e1b92bb9d019e68b Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Thu, 30 Nov 2000 18:38:47 +0000 Subject: Remove VARLENA_FIXED_SIZE hack, which is irreversibly broken now that both MULTIBYTE and TOAST prevent char(n) from being truly fixed-size. Simplify and speed up fastgetattr() and index_getattr() macros by eliminating special cases for attnum=1. It's just as fast to handle the first attribute by presetting its attcacheoff to zero; so do that instead when loading the tupledesc in relcache.c. --- src/backend/access/heap/heapam.c | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) (limited to 'src/backend/access/heap/heapam.c') diff --git a/src/backend/access/heap/heapam.c b/src/backend/access/heap/heapam.c index 7b60a897aa4..f345df7cc11 100644 --- a/src/backend/access/heap/heapam.c +++ b/src/backend/access/heap/heapam.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/access/heap/heapam.c,v 1.97 2000/11/30 08:46:20 vadim Exp $ + * $Header: /cvsroot/pgsql/src/backend/access/heap/heapam.c,v 1.98 2000/11/30 18:38:45 tgl Exp $ * * * INTERFACE ROUTINES @@ -535,18 +535,11 @@ fastgetattr(HeapTuple tup, int attnum, TupleDesc tupleDesc, ((isnull) ? (*(isnull) = false) : (dummyret) NULL), HeapTupleNoNulls(tup) ? ( - ((tupleDesc)->attrs[(attnum) - 1]->attcacheoff != -1 || - (attnum) == 1) ? + (tupleDesc)->attrs[(attnum) - 1]->attcacheoff >= 0 ? ( (Datum) fetchatt(&((tupleDesc)->attrs[(attnum) - 1]), (char *) (tup)->t_data + (tup)->t_data->t_hoff + - ( - ((attnum) != 1) ? - (tupleDesc)->attrs[(attnum) - 1]->attcacheoff - : - 0 - ) - ) + (tupleDesc)->attrs[(attnum) - 1]->attcacheoff) ) : nocachegetattr((tup), (attnum), (tupleDesc), (isnull)) -- cgit v1.2.3