Re: Using a single sequence for all tables

Поиск
Список
Период
Сортировка
От Peter J. Holzer
Тема Re: Using a single sequence for all tables
Дата
Msg-id YVQ4B8o7lDW1fi8K@hjp.at
обсуждение исходный текст
Ответ на Re: Using a single sequence for all tables  (Tobias Meyer <t9m@qad.com>)
Список pgsql-general
On 2021-09-29 11:42:42 +0200, Tobias Meyer wrote:
>     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.
[...]
>
> * you will have to pay attention to rollover/overflow situations more quickly. 

I'd subsume this under "ids will grow faster".

But I would actually see that as an advantage:

* All your ids have the same type, so either 32 bit is enough for
  everything or you use 64 bit (do the latter if in doubt).
* You only have to monitor a single sequence to see if you are close to
  an overflow, not dozens of them.
* You will probably be more aware that this might be a problem.

        hp

--
   _  | Peter J. Holzer    | Story must make more sense than reality.
|_|_) |                    |
| |   | hjp@hjp.at         |    -- Charles Stross, "Creative writing
__/   | http://www.hjp.at/ |       challenge!"

Вложения

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

Предыдущее
От: Tobias Meyer
Дата:
Сообщение: Re: Using a single sequence for all tables
Следующее
От: Laurenz Albe
Дата:
Сообщение: Re: Using a single sequence for all tables