Re: Column storage positions - Mailing list pgsql-hackers

From Andrew Dunstan
Subject Re: Column storage positions
Date
Msg-id 45DCC3CC.4030206@dunslane.net
Whole thread Raw
In response to Re: Column storage positions  (Stephan Szabo <sszabo@megazone.bigpanda.com>)
Responses Re: Column storage positions  (Gregory Stark <stark@enterprisedb.com>)
List pgsql-hackers

Stephan Szabo wrote:
>  What I was mentioning was that I was pretty sure that there
> was a message with someone saying that they actually tried something that
> did this and that they found left-most varchar access was slightly slower
> after the reordering although general access was faster. I believe the
> table case was alternating smallint and varchar columns, but I don't know
> what was tested for the retrieval. If that turns out to be able to be
> supported by other tests, then for some access patterns, the rearranged
> version might be slower.
>
>   

I would want to see this very carefully instrumented. Assuming we are 
putting all fixed size objects at the front, which seems like the best 
arrangement, then the position of every fixed field and the fixed 
portion of the position of every varlena field can be precalculated (and 
in the case of the leftmost varlena field that's it's complete 
position). So the extra effort in getting to the leftmost varchar field 
should be close to zero if this is done right, ISTM.

cheers

andrew


pgsql-hackers by date:

Previous
From: Alvaro Herrera
Date:
Subject: Re: autovacuum next steps, take 2
Next
From: "Florian G. Pflug"
Date:
Subject: Re: Column storage positions