Re: Changing Column Order (Was Re: MySQL vs PostgreSQL.) - Mailing list pgsql-hackers

From Bruce Momjian
Subject Re: Changing Column Order (Was Re: MySQL vs PostgreSQL.)
Date
Msg-id 200210141504.g9EF47W09439@candle.pha.pa.us
Whole thread Raw
In response to Re: Changing Column Order (Was Re: MySQL vs PostgreSQL.)  (Alessio Bragadini <alessio@albourne.com>)
Responses Re: Changing Column Order (Was Re: MySQL vs PostgreSQL.)
List pgsql-hackers
Alessio Bragadini wrote:
> On Sat, 2002-10-12 at 11:37, Gavin Sherry wrote:
> 
> > I cannot think of any reason why changing column order should be
> > implemented in Postgres. Seems like a waste of time/more code bloat for
> > something which is strictly asthetic.
> > 
> > Regardless, I do have collegues/clients who ask when such a feature will
> > be implemented. Why is this useful?
> 
> Has column ordering any effect on the physical tuple disposition? I've
> heard discussions about keeping fixed-size fields at the beginning of
> the tuple and similar.
> 
> Sorry for the lame question. :-)

Yes, column ordering matches physical column ordering in the file, and
yes, there is a small penalty for accessing any columns after the first
variable-length column (pg_type.typlen < 0). CHAR() used to be a fixed
length column, but with TOAST (large offline storage) it became variable
length too.  I don't think there is much of a performance hit, though.

--  Bruce Momjian                        |  http://candle.pha.pa.us pgman@candle.pha.pa.us               |  (610)
359-1001+  If your life is a hard drive,     |  13 Roberts Road +  Christ can be your backup.        |  Newtown Square,
Pennsylvania19073
 


pgsql-hackers by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: droped out precise time calculations in src/interfaces/libpq/fe-connect.c
Next
From: Alvaro Herrera
Date:
Subject: Re: Changing Column Order (Was Re: MySQL vs PostgreSQL.)