Re: logical column order and physical column order

From: Martijn van Oosterhout <kleptog(at)svana(dot)org>
To: Gavin Flower <GavinFlower(at)archidevsys(dot)co(dot)nz>
Cc: David Rowley <dgrowleyml(at)gmail(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: logical column order and physical column order
Date: 2013-11-03 10:35:05
Message-ID: 20131103103505.GA3552@svana.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Sun, Nov 03, 2013 at 09:40:18PM +1300, Gavin Flower wrote:
> I think the system should PHYSICALLY store the columns in the most
> space efficient order, and have a facility for mapping to & from the
> LOGICAL order - so that users & application developers only have
> worry about the logical order. Even system programers would
> normally not have to be concerned with the physical order. I am a
> little surprised that this is not already done, to be honest.

This has been discussed before, extensively. I beleive there have even
been some patches. Apart from the space savings it also allow postgres
to support column reordering of tables.

The main objection IIRC is that you now have a logical order and a
physical order and there would be an endless stream of bugs caused by
code confusing the two.

I don't really buy this: you can make the two identifiers
non-overlapping so you can always tell which kind you have and some
properly places checks will catch obvious problems. Logical order is
only used in a handful of places anyway. You could even make them two
seperate datatypes so the compiler will complain if you screw up.

Dig through the archives for the full story.

Have a nice day,
--
Martijn van Oosterhout <kleptog(at)svana(dot)org> http://svana.org/kleptog/
> He who writes carelessly confesses thereby at the very outset that he does
> not attach much importance to his own thoughts.
-- Arthur Schopenhauer

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Alvaro Herrera 2013-11-03 14:14:12 Re: logical column order and physical column order
Previous Message Gavin Flower 2013-11-03 08:40:18 Re: logical column order and physical column order