Re: Plan for compressed varlena headers

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Bruce Momjian <bruce(at)momjian(dot)us>
Cc: Gregory Stark <stark(at)enterprisedb(dot)com>, PostgreSQL Development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Plan for compressed varlena headers
Date: 2007-02-14 20:00:53
Message-ID: 4631.1171483253@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Bruce Momjian <bruce(at)momjian(dot)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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Alex Hayward 2007-02-14 20:09:26 Re: Reducing likelihood of deadlocks (was referential Integrity and SHARE locks)
Previous Message Tom Lane 2007-02-14 19:51:53 Re: "anyelement2" pseudotype