Re: Converting MySQL tinyint to PostgreSQL - Mailing list pgsql-general

From Jim C. Nasby
Subject Re: Converting MySQL tinyint to PostgreSQL
Date
Msg-id 20050719072105.GN38511@decibel.org
Whole thread Raw
In response to Re: Converting MySQL tinyint to PostgreSQL  (Dawid Kuroczko <qnex42@gmail.com>)
Responses Re: Converting MySQL tinyint to PostgreSQL
List pgsql-general
On Tue, Jul 19, 2005 at 02:02:28AM +0200, Dawid Kuroczko wrote:
> On 7/18/05, Lincoln Yeoh <lyeoh@pop.jaring.my> wrote:
> > However, maybe padding for alignment is a waste on the disk - disks being
> > so much slower than CPUs (not sure about that once the data is in memory ).
> > Maybe there should be an option to reorder columns so that less space is
> > wasted.
>
> Out of curiosity, do I understand right that if I create table
>
> CREATE TABLE sample1 (
>     a boolean,
>     b int,
>     c boolean
> );
>
> ...it will take more storage than:
>
> CREATE TABLE sample2 (
>     b int,
>     a boolean,
>     c boolean
> );
>
> ...I don't think such ordering should matter, but I would like to know
> how it really is. :)

Actually, I believe that's the case with just about every database,
though of course each one has different alignment constraints. The point
is that I don't know of any database that will silently re-order fields
under the covers to optimize storage.
--
Jim C. Nasby, Database Consultant               decibel@decibel.org
Give your computer some brain candy! www.distributed.net Team #1828

Windows: "Where do you want to go today?"
Linux: "Where do you want to go tomorrow?"
FreeBSD: "Are you guys coming, or what?"

pgsql-general by date:

Previous
From: Hubert Fröhlich
Date:
Subject: missing chunk number 0 for toast value ...
Next
From: Janning Vygen
Date:
Subject: Re: Changes to not deferred FK in 8.0.3 to 7.4?