Re: When to use name verses id

Поиск
Список
Период
Сортировка
От Josh Berkus
Тема Re: When to use name verses id
Дата
Msg-id web-684387@davinci.ethosmedia.com
обсуждение исходный текст
Ответ на Re: When to use name verses id  (Tom Lane <tgl@sss.pgh.pa.us>)
Список 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@agliodbs.com
   and data management solutions       (415) 565-7293
  for law firms, small businesses        fax 621-2533
    and non-profit organizations.      San Francisco

В списке pgsql-novice по дате отправления:

Предыдущее
От: "Josh Berkus"
Дата:
Сообщение: Re: limit of 16 on arguments to functons
Следующее
От: Sharon Cowling
Дата:
Сообщение: Problem with joins