pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
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 17:20:07 -0400
Message-ID: <17468.1119388807@sss.pgh.pa.us> (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>

Tobias Brox <tobias@nordicbet.com> writes:
> [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?

Certainly.  Bear in mind though that DROP INDEX will acquire exclusive
lock on the index's table, so until you roll back, no other transaction
will be able to touch the table at all.  So the whole thing may be a
nonstarter in a production database anyway :-(.  You can probably get
away with
	BEGIN;
	DROP INDEX ...
	EXPLAIN ...
	ROLLBACK;
if you fire it from a script rather than by hand --- but EXPLAIN
ANALYZE might be a bad idea ...

			regards, tom lane



view thread (14+ messages)  latest in thread

Message-ID: <17468.1119388807@sss.pgh.pa.us>
Permalink:  ../17468.1119388807@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/17468.1119388807@sss.pgh.pa.us

 · 

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: tgl@sss.pgh.pa.us, tobias@nordicbet.com, john@arbash-meinel.com, yves.vindevogel@implements.be
  Subject: Re: Limit clause not using index
  In-Reply-To: <17468.1119388807@sss.pgh.pa.us>

* 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