Re: Converting MySQL tinyint to PostgreSQL

From: "Jim C(dot) Nasby" <decibel(at)decibel(dot)org>
To: Dawid Kuroczko <qnex42(at)gmail(dot)com>
Cc: Lincoln Yeoh <lyeoh(at)pop(dot)jaring(dot)my>, Ron Mayer <rm_pg(at)cheapcomplexdevices(dot)com>, pgsql-general(at)postgresql(dot)org
Subject: Re: Converting MySQL tinyint to PostgreSQL
Date: 2005-07-19 07:21:05
Message-ID: 20050719072105.GN38511@decibel.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Tue, Jul 19, 2005 at 02:02:28AM +0200, Dawid Kuroczko wrote:
> On 7/18/05, Lincoln Yeoh <lyeoh(at)pop(dot)jaring(dot)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(at)decibel(dot)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?"

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Janning Vygen 2005-07-19 07:27:00 Re: Changes to not deferred FK in 8.0.3 to 7.4?
Previous Message Hubert Fröhlich 2005-07-19 07:15:51 missing chunk number 0 for toast value ...