Search Postgresql Archives

Re: question on serial key

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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.

-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux