Re: question on serial key

Поиск
Список
Период
Сортировка
От Grzegorz Jaśkiewicz
Тема Re: question on serial key
Дата
Msg-id 2f4958ff0905220656x73e83320kde8a97af9f40e00b@mail.gmail.com
обсуждение исходный текст
Ответ на question on serial key  (Brandon Metcalf <brandon@geronimoalloys.com>)
Ответы Re: question on serial key  (Brandon Metcalf <brandon@geronimoalloys.com>)
Список pgsql-general
you should use it, whenever you need db to keep its own key internally.
Advantage of sequence is also the fact, that you can have the sequence
value used on different columns/tables .

My rule of thumb is , in that case: as long as it is a short type (not
of toastable, or/and variable length), and as long as it won't change,
and is unique - I can use it. Otherwise, I use sequence to connect
rows internally for database.
First rule, is because of index access, and the way btree works.
Second is, because update of value will update other rows too - and
HOT won't help you here, so that's not efficient. And also, forcing it
to be unique is harder than.

Hth.

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

Предыдущее
От: Brandon Metcalf
Дата:
Сообщение: question on serial key
Следующее
От: Brandon Metcalf
Дата:
Сообщение: Re: question on serial key