Re: One Sequence for all tables or one Sequence for each

Поиск
Список
Период
Сортировка
От Janning Vygen
Тема Re: One Sequence for all tables or one Sequence for each
Дата
Msg-id 200506021402.25717.vygen@gmx.de
обсуждение исходный текст
Ответ на Re: One Sequence for all tables or one Sequence for each  (Martijn van Oosterhout <kleptog@svana.org>)
Список pgsql-general
Am Donnerstag, 2. Juni 2005 12:03 schrieb Martijn van Oosterhout:
> On Thu, Jun 02, 2005 at 12:58:33PM +0300, Kaloyan Iliev Iliev wrote:
> > Hi,
> >
> > I suppose the paralel work will be a problem if you are using one
> > sequence for all tables.
>
> I don't know about this. Sequences are designed to be very efficient,
> they don't rollback and can be cached by backends.
>
> In several of the databases I setup, I sometimes arranged for sequences
> to start at different points so when you setup a foreign key there was
> no chance you linked it to the wrong table. This especially in cases
> where there might be confusion about which table links where.
>
> Using one serial for everything does this even better. As for
> performance, I think disk I/O is going to be an issue before getting
> sequence numbers will be...

I guess i will use one sequence for all tables if there are now drawbacks.
BTW: OIDs are using the same conecpt, don't they? And for me it makes sense
to use a sequence only for getting a unique identifier and nothing else. even
better if this identifier is unique among all tables.

Thanks a lot for your opinions!

regards
janning


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

Предыдущее
От: Richard Huxton
Дата:
Сообщение: Re: Automate Postgres Backup In windows
Следующее
От: KÖPFERL Robert
Дата:
Сообщение: Re: [SQL] index row size 2728 exceeds btree maximum, 27