1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-23 03:21:12 +03:00

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.
This commit is contained in:
Tom Lane
2000-11-30 18:38:47 +00:00
parent 59a9735fc8
commit 1f5cc8c78a
7 changed files with 123 additions and 152 deletions

View File

@ -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))