Re: column ordering, was Re: [PATCHES] Enums patch v2 - Mailing list pgsql-hackers

From Tom Lane
Subject Re: column ordering, was Re: [PATCHES] Enums patch v2
Date
Msg-id 20900.1166720387@sss.pgh.pa.us
Whole thread Raw
In response to Re: column ordering, was Re: [PATCHES] Enums patch v2  (Martijn van Oosterhout <kleptog@svana.org>)
List pgsql-hackers
Martijn van Oosterhout <kleptog@svana.org> writes:
> I was envisiging the physical number to be fixed and immutable (ie
> storage position = permanent position).

There are two different problems being discussed here, and one of them
is insoluble if we take that position: people would like the system to
automatically lay out tables to minimize alignment overhead and access
costs (eg, put fixed-width columns first).  This is not the same as
"I would like to change the display column order".

It's true that for an ADD COLUMN that doesn't already force a table
rewrite, forcing one to improve packing is probably bad.  My thought
would be that we leave the column storage order alone if we don't have
to rewrite the table ... but any rewriting variant of ALTER TABLE could
optimize the storage order while it was at it.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Andrew Dunstan
Date:
Subject: Re: Release 8.2.0 done, 8.3 development starts
Next
From: Andrew Dunstan
Date:
Subject: Re: column ordering, was Re: [PATCHES] Enums patch v2