Re: Plan for compressed varlena headers - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Plan for compressed varlena headers
Date
Msg-id 4631.1171483253@sss.pgh.pa.us
Whole thread Raw
In response to Re: Plan for compressed varlena headers  (Bruce Momjian <bruce@momjian.us>)
Responses Re: Plan for compressed varlena headers  (Gregory Stark <stark@enterprisedb.com>)
List pgsql-hackers
Bruce Momjian <bruce@momjian.us> writes:
> Gregory Stark wrote:
>> If we want to allow storing >1 headers unaligned which I think would be
>> good then I still think we have to read them using bytewise lookups -- ie
>> by casting to (char*). That means network byte order or using the low order
>> bits is equally efficient.

> I think the plan was to have the macro code conditional on big-little
> endian.  We can deal with doing >1 headers unaligned at some future
> date if we feel we need it, and the macros will make it transparent.

Forcing bytewise access does not sound like a good plan to me --- you're
very much at the mercy of the compiler whether you get good code for
that.  Plus you can't do it without multiple evaluation of the macro
argument, which is something I'd really prefer we not introduce into
such a widely-used macro.  The only argument in favor is to save a
couple bytes of alignment padding, but since this is only going to
happen for wide data values, the significance of that is minimal.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: "anyelement2" pseudotype
Next
From: Alex Hayward
Date:
Subject: Re: Reducing likelihood of deadlocks (was referential Integrity and SHARE locks)