Re: Converting MySQL tinyint to PostgreSQL

Поиск
Список
Период
Сортировка
От Jim C. Nasby
Тема Re: Converting MySQL tinyint to PostgreSQL
Дата
Msg-id 20050719072105.GN38511@decibel.org
обсуждение исходный текст
Ответ на Re: Converting MySQL tinyint to PostgreSQL  (Dawid Kuroczko <qnex42@gmail.com>)
Ответы Re: Converting MySQL tinyint to PostgreSQL  (Dawid Kuroczko <qnex42@gmail.com>)
Список 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 по дате отправления:

Предыдущее
От: Hubert Fröhlich
Дата:
Сообщение: missing chunk number 0 for toast value ...
Следующее
От: Janning Vygen
Дата:
Сообщение: Re: Changes to not deferred FK in 8.0.3 to 7.4?