mirror of
https://github.com/postgres/postgres.git
synced 2025-10-25 13:17:41 +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:
@@ -7,7 +7,7 @@
|
||||
* Portions Copyright (c) 1996-2000, PostgreSQL, Inc
|
||||
* Portions Copyright (c) 1994, Regents of the University of California
|
||||
*
|
||||
* $Id: itup.h,v 1.25 2000/07/14 22:17:53 tgl Exp $
|
||||
* $Id: itup.h,v 1.26 2000/11/30 18:38:46 tgl Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -109,24 +109,17 @@ typedef RetrieveIndexResultData *RetrieveIndexResult;
|
||||
*(isnull) = false, \
|
||||
IndexTupleNoNulls(tup) ? \
|
||||
( \
|
||||
((tupleDesc)->attrs[(attnum)-1]->attcacheoff != -1 || \
|
||||
(attnum) == 1) ? \
|
||||
(tupleDesc)->attrs[(attnum)-1]->attcacheoff >= 0 ? \
|
||||
( \
|
||||
(Datum)fetchatt(&((tupleDesc)->attrs[(attnum)-1]), \
|
||||
(Datum) fetchatt(&((tupleDesc)->attrs[(attnum)-1]), \
|
||||
(char *) (tup) + \
|
||||
( \
|
||||
IndexTupleHasMinHeader(tup) ? \
|
||||
sizeof (*(tup)) \
|
||||
: \
|
||||
IndexInfoFindDataOffset((tup)->t_info) \
|
||||
) + \
|
||||
( \
|
||||
((attnum) != 1) ? \
|
||||
(tupleDesc)->attrs[(attnum)-1]->attcacheoff \
|
||||
: \
|
||||
0 \
|
||||
) \
|
||||
) \
|
||||
+ (tupleDesc)->attrs[(attnum)-1]->attcacheoff) \
|
||||
) \
|
||||
: \
|
||||
nocache_index_getattr((tup), (attnum), (tupleDesc), (isnull)) \
|
||||
|
||||
Reference in New Issue
Block a user