pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Michael Fuhr <mike@fuhr.org>
To: Tobias Brox <tobias@nordicbet.com>
Cc: John A Meinel <john@arbash-meinel.com>
Cc: Yves Vindevogel <yves.vindevogel@implements.be>
Cc: pgsql-performance@postgresql.org
Subject: Re: Limit clause not using index
Date: Tue, 21 Jun 2005 15:08:19 -0600
Message-ID: <20050621210819.GA82792@winnie.fuhr.org> (raw)
In-Reply-To: <20050621194639.GG22746@oppetid.no>
References: <d0da86521cd54473cac40df63bb14546@implements.be>
	<42B8275C.8040300@arbash-meinel.com>
	<7e514564b9a159480857de53cc1764fd@implements.be>
	<42B82ED0.1010009@arbash-meinel.com>
	<20050621194639.GG22746@oppetid.no>

On Tue, Jun 21, 2005 at 09:46:39PM +0200, Tobias Brox wrote:
> [John A Meinel - Tue at 10:14:24AM -0500]
> > I believe if you drop the indexes inside a transaction, they will still
> > be there for other queries, and if you rollback instead of commit, you
> > won't lose anything.
> 
> Has anyone tested this?

Observations from tests with 8.0.3:

DROP INDEX acquires an AccessExclusiveLock on the table and on the
index.  This will cause the transaction executing the DROP INDEX
to block until no other transaction holds any kind of lock on either,
and once the locks are acquired, no other transaction will be able
to access the table or the index until the transaction doing the
DROP INDEX commits or rolls back.  Rolling back leaves the index
in place.

-- 
Michael Fuhr
http://www.fuhr.org/~mfuhr/



view thread (14+ messages)  latest in thread

Message-ID: <20050621210819.GA82792@winnie.fuhr.org>
Permalink:  ../20050621210819.GA82792@winnie.fuhr.org/
Also on:    postgresql.org/message-id/20050621210819.GA82792@winnie.fuhr.org

 · 

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: mike@fuhr.org, tobias@nordicbet.com, john@arbash-meinel.com, yves.vindevogel@implements.be
  Subject: Re: Limit clause not using index
  In-Reply-To: <20050621210819.GA82792@winnie.fuhr.org>

* 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