Re: Column storage positions

From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: Stephan Szabo <sszabo(at)megazone(dot)bigpanda(dot)com>
Cc: Alvaro Herrera <alvherre(at)commandprompt(dot)com>, Martijn van Oosterhout <kleptog(at)svana(dot)org>, Phil Currier <pcurrier(at)gmail(dot)com>, "Florian G(dot) Pflug" <fgp(at)phlo(dot)org>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Column storage positions
Date: 2007-02-21 22:12:28
Message-ID: 45DCC3CC.4030206@dunslane.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Florian G. Pflug 2007-02-21 22:14:25 Re: Column storage positions
Previous Message Alvaro Herrera 2007-02-21 22:08:53 Re: autovacuum next steps, take 2