Re: Using a single sequence for all tables - Mailing list pgsql-general

From Tobias Meyer
Subject Re: Using a single sequence for all tables
Date
Msg-id CAAEpUZmfAbEOmApLBHf6vMr_gguCX+Kc3aBhK81oPiOfzH+08A@mail.gmail.com
Whole thread Raw
In response to Using a single sequence for all tables  ("Peter J. Holzer" <hjp-pgsql@hjp.at>)
Responses Re: Using a single sequence for all tables  ("Peter J. Holzer" <hjp-pgsql@hjp.at>)
List pgsql-general

Possible drawbacks:

 * The ids will grow faster, and they will be large even on small
   tables. It may be a bit irritating if you have a table with just 5
   rows and the ids are 5, 6, 7, 12654, 345953.
 * Bottleneck? Using a single sequence was said to be a performance
   bottleneck in Oracle. I didn't notice a performance difference then
   and I doubt it would be one in PostgreSQL, but if in doubt, measure!
 * Doesn't work with IDENTIY - those columns always use implicit
   sequences.
 * currval() is pretty useless with a global sequence. But I basically
   never use that anyway.

* you will have to pay attention to rollover/overflow situations more quickly. 
 
Just my 2 cent.
Tobias

pgsql-general by date:

Previous
From: "Peter J. Holzer"
Date:
Subject: Using a single sequence for all tables
Next
From: "Peter J. Holzer"
Date:
Subject: Re: Using a single sequence for all tables