Received: from localhost (mx1.hub.org [200.46.208.251]) by postgresql.org (Postfix) with ESMTP id D958F9FB38B for ; Wed, 4 Oct 2006 21:25:17 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) with ESMTP id 58973-04 for ; Wed, 4 Oct 2006 21:25:05 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey- Received: from outland.mohawksoft.com (unknown [64.46.156.80]) by postgresql.org (Postfix) with ESMTP id DDB129FB210 for ; Wed, 4 Oct 2006 21:25:04 -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 k950SYX2012546; Wed, 4 Oct 2006 20:28:34 -0400 Received: (from mohawk@localhost) by outland.mohawksoft.com (8.13.1/8.13.3/Submit) id k950SYGI012545; Wed, 4 Oct 2006 20:28:34 -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 20:28:34 -0400 (EDT) Message-ID: <21629.24.91.171.78.1160008114.squirrel@mail.mohawksoft.com> In-Reply-To: <24803.1160007491@sss.pgh.pa.us> References: <306b3b90a0fa1014e09717b77cca886b@biglumber.com> <87hcyj64d2.fsf@enterprisedb.com> <21728.24.91.171.78.1160006000.squirrel@mail.mohawksoft.com> <24803.1160007491@sss.pgh.pa.us> Date: Wed, 4 Oct 2006 20:28:34 -0400 (EDT) Subject: Re: Netflix Prize data From: "Mark Woodward" To: "Tom Lane" Cc: "Gregory Stark" , "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.06 tagged_above=0 required=5 tests=AWL X-Spam-Level: X-Archive-Number: 200610/263 X-Sequence-Number: 92160 > "Mark Woodward" writes: >> The rating, however, is one char 1~9. Would making it a char(1) buy >> anything? > > No, that would actually hurt because of the length word for the char > field. Even if you used the "char" type, which really is only one byte, > you wouldn't win anything because of alignment issues. Personally I'd > just go for three ints and a date, rather than trying to be cute with > the rating. Actually, the date is just days, right? I don't actualy need it too much. So, create a small int for date and do this: smalldate = date('1970-01-01') - rdate. And use small int for rating. Column | Type | Modifiers --------+----------+----------- movie | integer | client | integer | day | smallint | rating | smallint |