Received: from localhost (maia-3.hub.org [200.46.204.184]) by postgresql.org (Postfix) with ESMTP id AA6B79FA356 for ; Mon, 30 Jul 2007 07:49:03 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.184]) (amavisd-maia, port 10024) with ESMTP id 71681-04 for ; Mon, 30 Jul 2007 07:48:45 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.5 Received: from mail.metronet.co.uk (mail.metronet.co.uk [213.162.97.75]) by postgresql.org (Postfix) with ESMTP id 79F259FA2B2 for ; Mon, 30 Jul 2007 07:49:00 -0300 (ADT) Received: from server3.office.archonet.com (84-51-143-99.archon037.adsl.metronet.co.uk [84.51.143.99]) by smtp.metronet.co.uk (MetroNet Mail) with ESMTP id 1C55F74213; Mon, 30 Jul 2007 11:48:58 +0100 (BST) Received: from [192.168.1.36] (dell36.office.archonet.com [192.168.1.36]) by server3.office.archonet.com (Postfix) with ESMTP id 6DF9E274065; Mon, 30 Jul 2007 11:48:55 +0100 (BST) Message-ID: <46ADC217.7010607@archonet.com> Date: Mon, 30 Jul 2007 11:48:55 +0100 From: Richard Huxton User-Agent: Thunderbird 2.0.0.0 (X11/20070326) MIME-Version: 1.0 To: Jay Kang Cc: pgsql-performance@postgresql.org Subject: Re: Questions on Tags table schema References: <46AD917E.3050902@archonet.com> <46ADBD35.4000304@archonet.com> In-Reply-To: <46ADBD35.4000304@archonet.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200707/420 X-Sequence-Number: 26104 Richard Huxton wrote: > >> CREATE TABLE car_tags >> ( >> CarID integer NOT NULL, >> TagID integer NOT NULL >> ); > [snip other table defs] > > Don't forget CarID isn't really an integer (I mean, you're not going to > be doing sums with car id's are you?) it's actually just a unique code. > Of course, computers are particularly fast at dealing with 32-bit integers. Just realised I haven't explained what I meant by that. CarID is a different type from PlaneID and TagID. As it happens, we are using integers to represent them all, but a CarID = 1 is different from a PlaneID = 1 and although you can numerically compare the two it is an error to do so. -- Richard Huxton Archonet Ltd