Skip site navigation (1) Skip section navigation (2)

Peripheral Links

Header And Logo

PostgreSQL
| The world's most advanced open source database.

Site Navigation

Search archives
  Advanced Search

Re: disabling an index without deleting it?


  • From: Jeff Davis <pgsql(at)j-davis(dot)com>
  • To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
  • Cc: "Joshua D. Drake" <jd(at)commandprompt(dot)com>, Scott Marlowe <scott(dot)marlowe(at)gmail(dot)com>, Peter Koczan <pjkoczan(at)gmail(dot)com>, pgsql-performance <pgsql-performance(at)postgresql(dot)org>
  • Subject: Re: disabling an index without deleting it?
  • Date: Wed, 27 Feb 2008 11:16:58 -0800
  • Message-id: <1204139818.16886.29.camel@dogma.ljc.laika.com> <text/plain>

On Tue, 2008-02-26 at 17:22 -0500, Tom Lane wrote:
> "Joshua D. Drake" <jd(at)commandprompt(dot)com> writes:
> > "Scott Marlowe" <scott(dot)marlowe(at)gmail(dot)com> wrote:
> >> begin;
> >> drop index abc_dx;
> >> select ....
> >> rollback;
> >> 
> >> and viola, your index is still there.  note that there are likely some
> >> locking issues with this, so be careful with it in production.  But on
> >> a test box it's a very easy way to test various indexes.
> 
> > Wouldn't you also bloat the index?
> 
> No, what makes you think that?  The index won't change at all in the
> above example.  The major problem is, as Scott says, that DROP INDEX
> takes exclusive lock on the table so any other sessions will be locked
> out of it for the duration of your test query.

It may cause catalog bloat though, right?

Regards,
	Jeff Davis




Home | Main Index | Thread Index

Privacy Policy | About PostgreSQL
Copyright © 1996 – 2012 PostgreSQL Global Development Group