Received: from localhost (unknown [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id E5B362E0045 for ; Wed, 27 Feb 2008 15:17:12 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 79952-02 for ; Wed, 27 Feb 2008 15:17:03 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey-1.7.5 Received: from serv01.siteground137.com (ns1.siteground137.com [67.15.250.10]) by postgresql.org (Postfix) with ESMTP id 6BEFE2E0032 for ; Wed, 27 Feb 2008 15:17:03 -0400 (AST) Received: from cragnux.laika.com ([209.162.219.253]:50419 helo=dogma.ljc.laika.com) by serv01.siteground137.com with esmtpa (Exim 4.68) (envelope-from ) id 1JURm1-00072E-1o; Wed, 27 Feb 2008 13:17:01 -0600 Subject: Re: disabling an index without deleting it? From: Jeff Davis To: Tom Lane Cc: "Joshua D. Drake" , Scott Marlowe , Peter Koczan , pgsql-performance In-Reply-To: <9050.1204064560@sss.pgh.pa.us> References: <4544e0330802261246t574167fdpc47629d1bbe64fed@mail.gmail.com> <20080226130339.64bd4ec3@commandprompt.com> <9050.1204064560@sss.pgh.pa.us> Content-Type: text/plain Date: Wed, 27 Feb 2008 11:16:58 -0800 Message-Id: <1204139818.16886.29.camel@dogma.ljc.laika.com> Mime-Version: 1.0 X-Mailer: Evolution 2.0.4 (2.0.4-7) Content-Transfer-Encoding: 7bit X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - serv01.siteground137.com X-AntiAbuse: Original Domain - postgresql.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - j-davis.com X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200802/377 X-Sequence-Number: 28919 On Tue, 2008-02-26 at 17:22 -0500, Tom Lane wrote: > "Joshua D. Drake" writes: > > "Scott Marlowe" 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