From: Gregory Stark <stark@enterprisedb.com>
To: Greg Sabino Mullane <greg@turnstep.com>
Cc: pgsql-hackers@postgresql.org
Subject: Re: Netflix Prize data
Date: Wed, 04 Oct 2006 19:36:09 -0400
Message-ID: <87hcyj64d2.fsf@enterprisedb.com> (raw)
In-Reply-To: <306b3b90a0fa1014e09717b77cca886b@biglumber.com>
References: <306b3b90a0fa1014e09717b77cca886b@biglumber.com>
"Greg Sabino Mullane" <greg@turnstep.com> writes:
> CREATE TABLE rating (
> movie SMALLINT NOT NULL,
> person INTEGER NOT NULL,
> rating SMALLINT NOT NULL,
> viewed DATE NOT NULL
> );
You would probably be better off putting the two smallints first followed by
the integer and date. Otherwise both the integer and the date field will have
an extra two bytes of padding wasting 4 bytes of space.
If you reorder the fields that way you'll be down to 28 bytes of tuple header
overhead and 12 bytes of data. There's actually another 4 bytes in the form of
the line pointer so a total of 44 bytes per record. Ie, almost 73% of the disk
i/o you're seeing is actually per-record overhead.
--
Gregory Stark
EnterpriseDB http://www.enterprisedb.com
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-hackers@postgresql.org
Cc: stark@enterprisedb.com, greg@turnstep.com
Subject: Re: Netflix Prize data
In-Reply-To: <87hcyj64d2.fsf@enterprisedb.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox