Re: SERIAL behaviour

Поиск
Список
Период
Сортировка
От Curt Sampson
Тема Re: SERIAL behaviour
Дата
Msg-id Pine.NEB.4.44.0207152226130.492-100000@angelic.cynic.net
обсуждение исходный текст
Ответ на SERIAL behaviour  (Eugene <foo@bar.com>)
Список pgsql-general
On Sat, 13 Jul 2002, Eugene wrote:

> The problem is that on a rollback, the value of the sequence does not go
> back to its previous value!

And this is a big efficiency win. Say you get sequence number 100.
You start your work, and while you're chugging along, three other
transactions also start, and also request sequence numbers, getting
101, 102 and 103. If you then rollback your transaction, you can't put
the sequence number back to 100 unless you force the following three
transactions also to abort.

Alternatively, you could lock the sequence while the transaction is
running, but then numbers 101, 102 and 103 would have to wait for your
number 100 transaction to commit or roll back before they could even
start to work, thus slowing down the system.

cjs
--
Curt Sampson  <cjs@cynic.net>   +81 90 7737 2974   http://www.netbsd.org
    Don't you know, in this new Dark Age, we're all light.  --XTC


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

Предыдущее
От: Jan Wieck
Дата:
Сообщение: Re: I am being interviewed by OReilly
Следующее
От: Thomas Beutin
Дата:
Сообщение: Re: help (maybe i'm a little stupid)