Re: Changing Column Order (Was Re: MySQL vs PostgreSQL.)

From: Jan Wieck <JanWieck(at)Yahoo(dot)com>
To: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
Cc: Alessio Bragadini <alessio(at)albourne(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Changing Column Order (Was Re: MySQL vs PostgreSQL.)
Date: 2002-10-15 14:37:41
Message-ID: 3DAC2835.2BA5CB60@Yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-hackers pgsql-jdbc

Bruce Momjian wrote:
>
> 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.

When was char() fixed size? We had fixed size things like char, char2,
char4 ... char16. But char() is internally bpchar() and has allways been
variable-length.

Jan

--

#======================================================================#
# It's easier to get forgiveness for being wrong than for being right. #
# Let's break this rule - forgive me. #
#================================================== JanWieck(at)Yahoo(dot)com #

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Josh Burdick 2002-10-15 14:40:49 Re: question about executing JOINs
Previous Message Richard Huxton 2002-10-15 13:25:42 Re: RV: bad result in a query!! :-(

Browse pgsql-hackers by date

  From Date Subject
Next Message Gavin Sherry 2002-10-15 14:44:43 Re: Disabling triggers (was Re: pgsql 7.2.3 crash)
Previous Message Jan Wieck 2002-10-15 13:33:38 Re: orderRules() now a bad idea?

Browse pgsql-jdbc by date

  From Date Subject
Next Message jonerf1 2002-10-15 16:17:36 blob load errors
Previous Message Kris Jurka 2002-10-14 17:44:39 Re: JDBC exception when call updateNull within an updateable ResultSet