Received: from localhost (mx1.hub.org [200.46.208.251]) by postgresql.org (Postfix) with ESMTP id 2261C9FB235 for ; Thu, 19 Oct 2006 10:44:25 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) with ESMTP id 02066-09 for ; Thu, 19 Oct 2006 10:44:18 -0300 (ADT) X-Greylist: delayed 23:19:44.486811 by SQLgrey- Received: from mail.ritek.hu (mail.ritek.hu [82.131.192.50]) by postgresql.org (Postfix) with ESMTP id 174929FB20F for ; Thu, 19 Oct 2006 10:44:17 -0300 (ADT) Received: from localhost (localhost.localdomain [127.0.0.1]) by mail.ritek.hu (Postfix) with ESMTP id 42A6D8C0054 for ; Thu, 19 Oct 2006 15:44:09 +0200 (CEST) Received: from mail.ritek.hu ([127.0.0.1]) by localhost (mail.ritek.hu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 25128-07 for ; Thu, 19 Oct 2006 15:44:08 +0200 (CEST) Received: from [10.1.2.11] (unknown [10.1.2.11]) by mail.ritek.hu (Postfix) with ESMTP id 586E08C0052 for ; Thu, 19 Oct 2006 15:44:08 +0200 (CEST) Message-ID: <4537812A.3060408@ritek.hu> Date: Thu, 19 Oct 2006 15:44:10 +0200 From: Atesz User-Agent: Thunderbird 1.5.0.7 (Windows/20060909) MIME-Version: 1.0 To: pgsql-performance@postgresql.org Subject: Re: ACCESS EXCLUSIVE lock References: <4536391E.7040604@ritek.hu> <1161185300.8706.82.camel@state.g2switchworks.com> In-Reply-To: <1161185300.8706.82.camel@state.g2switchworks.com> Content-Type: text/plain; charset=ISO-8859-2; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new-20030616-p10 (Debian) at ritek.hu X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests= X-Spam-Level: X-Archive-Number: 200610/398 X-Sequence-Number: 21527 Scott Marlowe wrote: > What if, a minute or two after the drop contraint, you issue a rollback? > After the DROP CONSTRAINT I insert 4 million rekords into the TABLE b. After the inserts I remake the dropped constraints, and commit the transaction (P1). This solution is faster then the conventional method without the constraint's trick. In my work the table A is a dictionary table (key-value pairs) with 100-200 records, and the TABLE b has 20 columns with 10 references to TABLE a. So my experience is that I have to drop constraints before the 4 million inserts and remake those after it. If there is an error in my transaction (P1) and I have to rollback, there isn't problem, because my inserts lost from TABLE b and the dropped constraints may be rolled back. In my opinion there isn't exclusion between a dropped constraint (reference from b to a) and a select on TABLE a. If I think well the dropped constraint have to seem in other transation (for example: P2). And it doesn't have to seem in my transaction, because it has already dropped. Thanks your suggestions! Regards, Antal Attila