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

From Bruce Momjian
Subject Re: Converting MySQL tinyint to PostgreSQL
Date
Msg-id 200507132352.j6DNq4x15417@candle.pha.pa.us
Whole thread Raw
In response to Re: Converting MySQL tinyint to PostgreSQL  (Ron Mayer <rm_pg@cheapcomplexdevices.com>)
Responses Re: Converting MySQL tinyint to PostgreSQL
List 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@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073

pgsql-general by date:

Previous
From: Karsten Hilbert
Date:
Subject: Re: Table Update Systems (was: chosing a database name)
Next
From: Bruce Momjian
Date:
Subject: Re: Transparent encryption in PostgreSQL?