Re: Converting MySQL tinyint to PostgreSQL

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Ron Mayer <rm_pg(at)cheapcomplexdevices(dot)com>
Cc: Martijn van Oosterhout <kleptog(at)svana(dot)org>, pgsql-general(at)postgresql(dot)org
Subject: Re: Converting MySQL tinyint to PostgreSQL
Date: 2005-07-13 23:52:04
Message-ID: 200507132352.j6DNq4x15417@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Ron Mayer wrote:
> Martijn van Oosterhout wrote:
> >
> > Well, you get another issue, alignment. If you squeeze your string
> > down, the next field, if it is an int or string, will get padded to a
> > multiple of 4 negating most of the gains. Like in C structures, there
> > is padding to optimise access.
>
> Anecdotally I hear at least as many people say that their database
> is more I/O bound than CPU bound; and it seems that adding bytes
> for alignment is a way of reducing CPU for more disk I/O.
>
> I guess unaligned access so expensive that it makes up for the extra i/o?

This is a good point. We have always stored data on disk that exactly
matches its layout in memory. We could change that, but no one has
shown it would be a win.

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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Bruce Momjian 2005-07-14 00:05:17 Re: Transparent encryption in PostgreSQL?
Previous Message Karsten Hilbert 2005-07-13 23:29:52 Re: Table Update Systems (was: chosing a database name)