Re: auto_increment

Поиск
Список
Период
Сортировка
От Christopher Browne
Тема Re: auto_increment
Дата
Msg-id m365jnd0gc.fsf@wolfe.cbbrowne.com
обсуждение исходный текст
Ответ на Re: auto_increment  ("Muhyiddin A.M Hayat" <middink@indo.net.id>)
Список pgsql-sql
In the last exciting episode, middink@indo.net.id ("Muhyiddin A.M Hayat") wrote:
> Ok, but if i do rollback, the auto_increment don't roolback.

Right, it's not supposed to.

Think about the situation where you have 5 clients connecting to the
database and adding records to this table.

The current functionality of sequences means that with a little
cacheing of values, they can all be hammering the table with inserts
and never need to worry about what the other is doing.

If the increment was rolling back by one when an INSERT was rolled
back, that would mean that the cache size was just 1, and access to
that sequence would have to be serialized across all accessors, which
would slow it down incredibly.
-- 
(format nil "~S@~S" "cbbrowne" "ntlug.org")
http://www3.sympatico.ca/cbbrowne/oses.html
"Let me blow that up a bit more for you."
-- Colin Powell, Discussing a picture of the intelligence compound in  Iraq


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

Предыдущее
От: "Martin Kuria"
Дата:
Сообщение: sub query
Следующее
От: Peter Eisentraut
Дата:
Сообщение: Re: sub query