pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Richard Huxton <dev@archonet.com>
To: Jay Kang <arrival123@gmail.com>
Cc: pgsql-performance@postgresql.org
Subject: Re: Questions on Tags table schema
Date: Mon, 30 Jul 2007 11:48:55 +0100
Message-ID: <46ADC217.7010607@archonet.com> (raw)
In-Reply-To: <46ADBD35.4000304@archonet.com>
References: <d251ee4a0707290722k50de5789lad616cb168791058@mail.gmail.com>
	<46AD917E.3050902@archonet.com>
	<d251ee4a0707300313y5e648fa3kdc5df88180df82db@mail.gmail.com>
	<46ADBD35.4000304@archonet.com>

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



view thread (9+ messages)  latest in thread

Message-ID: <46ADC217.7010607@archonet.com>
Permalink:  ../46ADC217.7010607@archonet.com/
Also on:    postgresql.org/message-id/46ADC217.7010607@archonet.com

 · 

reply

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-performance@postgresql.org
  Cc: dev@archonet.com, arrival123@gmail.com
  Subject: Re: Questions on Tags table schema
  In-Reply-To: <46ADC217.7010607@archonet.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