X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 8CCF95283F for ; Fri, 17 Jun 2005 01:08:20 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 87491-08 for ; Fri, 17 Jun 2005 04:08:15 +0000 (GMT) Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by svr1.postgresql.org (Postfix) with ESMTP id 3830552818 for ; Fri, 17 Jun 2005 01:08:12 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.13.1/8.13.1) with ESMTP id j5H489o2015556; Fri, 17 Jun 2005 00:08:09 -0400 (EDT) To: =?ISO-8859-1?Q?Veikko_M=E4kinen?= Cc: pgsql-performance@postgresql.org Subject: Re: How does the transaction buffer work? In-reply-to: <42B1D2DE.4020709@ecom.fi> References: <42B1D2DE.4020709@ecom.fi> Comments: In-reply-to =?ISO-8859-1?Q?Veikko_M=E4kinen?= message dated "Thu, 16 Jun 2005 22:28:30 +0300" Date: Fri, 17 Jun 2005 00:08:09 -0400 Message-ID: <15555.1118981289@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.005 tagged_above=0 required=5 tests=AWL X-Spam-Level: X-Archive-Number: 200506/346 X-Sequence-Number: 12983 =?ISO-8859-1?Q?Veikko_M=E4kinen?= writes: > How does Postgres (8.0.x) buffer changes to a database within a > transaction? I need to insert/update more than a thousand rows (mayde > even more than 10000 rows, ~100 bytes/row) in a table but the changes > must not be visible to other users/transactions before every row is > updated. There were some other responses already, but I wanted to add this: there isn't any "transaction buffer" in Postgres. The above scenario won't cause us any noticeable problem, because what we do is mark each row with its originating transaction ID, and then readers compare that to the set of transaction IDs that they think are "in the past". The number of rows affected by a transaction is not really a factor at all. Now of course this isn't Nirvana, you must pay somewhere ;-) and our weak spot is the need for VACUUM. But you have no need to fear large individual transactions. regards, tom lane