Re: Approaches for Lookup values (codes) in OLTP application

Поиск
Список
Период
Сортировка
От Decibel!
Тема Re: Approaches for Lookup values (codes) in OLTP application
Дата
Msg-id 7AD65D69-F724-4A71-B234-B5F1D7713899@decibel.org
обсуждение исходный текст
Ответ на Re: Approaches for Lookup values (codes) in OLTP application  ("Scott Marlowe" <scott.marlowe@gmail.com>)
Список pgsql-general
On Feb 15, 2008, at 1:43 PM, Scott Marlowe wrote:
> Generally speaking, I tend towards using the real value as the key and
> foreign key in lookup tables, but occasionally using an artificial
> numeric key is a better choice.


Something to consider here... any table that will have either a lot
of rows or a lot of "type" fields will likely be better off with a
phantom key (such as a serial) rather than storing text values in the
base table. As an example, we have a 500G database at work that
currently doesn't use any phantom keys for this kind of thing. I
recently estimated that if I normalized every field where doing so
would save more than 1MB it would reduce the size of the database by
142GB. Granted, about half of that is in a somewhat unusual table
that logs emails (a lot of the emails have the same text, so the gain
there is from normalizing that), but even discounting that 75G is
nothing to sneeze at in an OLTP database.
--
Decibel!, aka Jim C. Nasby, Database Architect  decibel@decibel.org
Give your computer some brain candy! www.distributed.net Team #1828



Вложения

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

Предыдущее
От: Decibel!
Дата:
Сообщение: Re: unnesesary sorting after Merge Full Join
Следующее
От: dvanatta
Дата:
Сообщение: Return Query with simple function