From: | "Josh Berkus" <josh(at)agliodbs(dot)com> |
---|---|
To: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, lbergman(at)abi(dot)tconline(dot)net |
Cc: | pgsql-novice(at)postgresql(dot)org |
Subject: | Re: When to use name verses id |
Date: | 2002-02-04 19:30:01 |
Message-ID: | web-684387@davinci.ethosmedia.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-novice |
Lewis,
> Integer IDs are probably also more compact and faster to compare than
> strings, but this effect is not so strong that it should govern your
> decisions. If you don't really need an ID column, I think you're
> better off without one.
A number of database books have long discussions on ID columns, keys,
and how to effeciently identify unique rows. In fact, half the DB and
SQL books on either book page (from www.postgresql.org or from
techdocs.postgresql.org) have such chapters.
Make sure that if you are going to rely on a name column as your unique
value, that you make it your table's Primary Key or at least put a
Unique Index on it. Tables without primary keys are disasters in the
making ...
-Josh Berkus
______AGLIO DATABASE SOLUTIONS___________________________
Josh Berkus
Complete information technology josh(at)agliodbs(dot)com
and data management solutions (415) 565-7293
for law firms, small businesses fax 621-2533
and non-profit organizations. San Francisco
From | Date | Subject | |
---|---|---|---|
Next Message | Sharon Cowling | 2002-02-04 20:09:00 | Problem with joins |
Previous Message | Josh Berkus | 2002-02-04 17:04:16 | Re: limit of 16 on arguments to functons |