pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Atesz <atesz@ritek.hu>
To: pgsql-performance@postgresql.org
Subject: Re: ACCESS EXCLUSIVE lock
Date: Thu, 19 Oct 2006 15:44:10 +0200
Message-ID: <4537812A.3060408@ritek.hu> (raw)
In-Reply-To: <1161185300.8706.82.camel@state.g2switchworks.com>
References: <4536391E.7040604@ritek.hu>
	<1161185300.8706.82.camel@state.g2switchworks.com>

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



view thread (5+ messages)  latest in thread

Message-ID: <4537812A.3060408@ritek.hu>
Permalink:  ../4537812A.3060408@ritek.hu/
Also on:    postgresql.org/message-id/4537812A.3060408@ritek.hu

 · 

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-performance@postgresql.org
  Cc: atesz@ritek.hu
  Subject: Re: ACCESS EXCLUSIVE lock
  In-Reply-To: <4537812A.3060408@ritek.hu>

* 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