Skip site navigation (1) Skip section navigation (2)

Re: Questions on Tags table schema

From: Richard Huxton <dev(at)archonet(dot)com>
To: Jay Kang <arrival123(at)gmail(dot)com>
Cc: pgsql-performance(at)postgresql(dot)org
Subject: Re: Questions on Tags table schema
Date: 2007-07-30 10:48:55
Message-ID: 46ADC217.7010607@archonet.com (view raw or flat)
Thread:
Lists: pgsql-performance
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

In response to

pgsql-performance by date

Next:From: Jay KangDate: 2007-07-30 11:26:10
Subject: Re: Questions on Tags table schema
Previous:From: Richard HuxtonDate: 2007-07-30 10:28:05
Subject: Re: Questions on Tags table schema

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group