X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.130]) by svr1.postgresql.org (Postfix) with ESMTP id 9164CD1B8B3 for ; Sat, 20 Sep 2003 14:10:18 +0000 (GMT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (neptune.hub.org [64.117.224.130]) (amavisd-new, port 10024) with ESMTP id 52226-03 for ; Sat, 20 Sep 2003 11:10:11 -0300 (ADT) Received: from news.hub.org (unknown [64.117.224.194]) by svr1.postgresql.org (Postfix) with ESMTP id 0C14AD1B565 for ; Sat, 20 Sep 2003 11:10:08 -0300 (ADT) Received: from news.hub.org (host-64-117-224-194.altec1.com [64.117.224.194] (may be forged)) by news.hub.org (8.12.9/8.12.9) with ESMTP id h8KEA3sl054465 for ; Sat, 20 Sep 2003 14:10:03 GMT (envelope-from news@news.hub.org) Received: (from news@localhost) by news.hub.org (8.12.9/8.12.9/Submit) id h8KE4IkP053778 for pgsql-sql@postgresql.org; Sat, 20 Sep 2003 14:04:18 GMT From: Christopher Browne X-Newsgroups: comp.databases.postgresql.sql Subject: Re: auto_increment Date: Sat, 20 Sep 2003 10:00:19 -0400 Organization: cbbrowne Computing Inc Lines: 22 Message-ID: References: <001d01c37f3e$983ed3a0$2363a8c0@ckeskin> <002201c37f54$29608e40$1f00a8c0@middinkcomp> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Complaints-To: usenet@news.hub.org X-message-flag: Outlook is rather hackable, isn't it? X-Home-Page: http://www.cbbrowne.com/info/ X-Affero: http://svcs.affero.net/rm.php?r=cbbrowne User-Agent: Gnus/5.1003 (Gnus v5.10.3) XEmacs/21.4 (Rational FORTRAN, linux) Cancel-Lock: sha1:oem7GuzGMhvOOJYrJbzn+E6vPyE= To: pgsql-sql@postgresql.org X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200309/225 X-Sequence-Number: 15203 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