pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Christopher Browne <cbbrowne@acm.org>
To: pgsql-sql@postgresql.org
Subject: Re: auto_increment
Date: Sat, 20 Sep 2003 10:00:19 -0400
Message-ID: <m365jnd0gc.fsf@wolfe.cbbrowne.com> (raw)
References: <001d01c37f3e$983ed3a0$2363a8c0@ckeskin>
	<002201c37f54$29608e40$1f00a8c0@middinkcomp>

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



view thread (27+ messages)  latest in thread

Message-ID: <m365jnd0gc.fsf@wolfe.cbbrowne.com>
Permalink:  ../m365jnd0gc.fsf@wolfe.cbbrowne.com/
Also on:    postgresql.org/message-id/m365jnd0gc.fsf@wolfe.cbbrowne.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: cbbrowne@acm.org
  Subject: Re: auto_increment
  In-Reply-To: <m365jnd0gc.fsf@wolfe.cbbrowne.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox