Received: from localhost (wm.hub.org [200.46.204.128]) by postgresql.org (Postfix) with ESMTP id 68B919FB21D for ; Wed, 4 Oct 2006 20:50:03 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) with ESMTP id 67420-07 for ; Wed, 4 Oct 2006 23:49:52 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey- Received: from outland.mohawksoft.com (unknown [64.46.156.80]) by postgresql.org (Postfix) with ESMTP id 258159FB210 for ; Wed, 4 Oct 2006 20:49:51 -0300 (ADT) Received: from outland.mohawksoft.com (localhost.localdomain [127.0.0.1]) by outland.mohawksoft.com (8.13.1/8.9.3) with ESMTP id k94NrKS5012256; Wed, 4 Oct 2006 19:53:20 -0400 Received: (from mohawk@localhost) by outland.mohawksoft.com (8.13.1/8.13.3/Submit) id k94NrK9K012255; Wed, 4 Oct 2006 19:53:20 -0400 X-Authentication-Warning: outland.mohawksoft.com: mohawk set sender to pgsql@mohawksoft.com using -f Received: from 24.91.171.78 (SquirrelMail authenticated user pgsql) by mail.mohawksoft.com with HTTP; Wed, 4 Oct 2006 19:53:20 -0400 (EDT) Message-ID: <21728.24.91.171.78.1160006000.squirrel@mail.mohawksoft.com> In-Reply-To: <87hcyj64d2.fsf@enterprisedb.com> References: <306b3b90a0fa1014e09717b77cca886b@biglumber.com> <87hcyj64d2.fsf@enterprisedb.com> Date: Wed, 4 Oct 2006 19:53:20 -0400 (EDT) Subject: Re: Netflix Prize data From: "Mark Woodward" To: "Gregory Stark" Cc: "Greg Sabino Mullane" , pgsql-hackers@postgresql.org User-Agent: SquirrelMail/1.4.7 MIME-Version: 1.0 Content-Type: text/plain;charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Priority: 3 (Normal) Importance: Normal X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.001 tagged_above=0 required=5 tests=UNPARSEABLE_RELAY X-Spam-Level: X-Archive-Number: 200610/261 X-Sequence-Number: 92158 > > "Greg Sabino Mullane" 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. > That's good advice, however, It is said that Netflix has greater than 64K movies, so, while the test info may work with a small int, I doubt the overall system would work. The rating, however, is one char 1~9. Would making it a char(1) buy anything? In wonder.... If I started screwing around with movie ID and rating, and moved them into one int. One byte for rating, three bytes for movie ID. That could reduce the data size by at least half gig.