Re: guaranteeing that a sequence never skips (fwd)

Поиск
Список
Период
Сортировка
От Mike Nolan
Тема Re: guaranteeing that a sequence never skips (fwd)
Дата
Msg-id 200410032023.i93KNHGO022319@gw.tssi.com
обсуждение исходный текст
Ответ на Re: guaranteeing that a sequence never skips (fwd)  (Christopher Browne <cbbrowne@acm.org>)
Список pgsql-general
> Then, every once in a while, a separate process would go in, see the
> highest value on idfield < 250M, and rewrite the idfield on all of the
> tuples where idfield > 250M.  It would be efficient due to the partial
> index.  It limits the number of documents to 250M, but I'm sure that
> can be alleviated when it turns into an issue...

I think you'd be better off using two columns.  Call the first one the
'work ticket' for the check request, and you don't really care if it has gaps
in it or not, its primary purpose is to ensure that each check request
has a unique document number of some kind, so a sequence works fine.

One and only one program assigns the actual check numbers--in a separate
column.

That's the sort of thing that most commercial packages do, even though it
seems clumsy and adds an extra step, and that's why they do it that way, too.
--
Mike Nolan

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

Предыдущее
От: Scott Ribe
Дата:
Сообщение: Re: Out of memory errors on OS X
Следующее
От: Gaetano Mendola
Дата:
Сообщение: Re: VACUUM FULL on 24/7 server