Received: from localhost (maia-4.hub.org [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id C20139FB64F for ; Fri, 16 Feb 2007 10:55:07 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-new, port 10024) with ESMTP id 46544-02 for ; Fri, 16 Feb 2007 10:55:04 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey-1.7.4 Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by postgresql.org (Postfix) with ESMTP id 71D1C9FB449 for ; Fri, 16 Feb 2007 10:55:04 -0400 (AST) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.13.6/8.13.6) with ESMTP id l1GErjZ0021264; Fri, 16 Feb 2007 09:53:45 -0500 (EST) To: "Gauri Kanekar" cc: "Michael Fuhr" , pgsql-performance@postgresql.org Subject: Re: Not Picking Index In-reply-to: <7e4ba9550702160631j5b428addr199bd87bd0704dc3@mail.gmail.com> References: <7e4ba9550702160456m6e86e809oc35dd68620348c80@mail.gmail.com> <20070216142804.GA44536@winnie.fuhr.org> <7e4ba9550702160631j5b428addr199bd87bd0704dc3@mail.gmail.com> Comments: In-reply-to "Gauri Kanekar" message dated "Fri, 16 Feb 2007 20:01:16 +0530" Date: Fri, 16 Feb 2007 09:53:45 -0500 Message-ID: <21263.1171637625@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.063 tagged_above=0 required=5 tests=AWL, BAYES_50, SPF_HELO_PASS, SPF_PASS X-Spam-Level: X-Archive-Number: 200702/184 X-Sequence-Number: 23238 "Gauri Kanekar" writes: > I want the planner to ignore a specific index. > I am testing some query output. For that purpose i dont want the index. > I that possible to ignore a index by the planner. begin; drop index soandso; explain analyze ...; rollback; Note the DROP INDEX will acquire exclusive lock on the table, so this might not be the greatest thing to do in a production environment. In PG 8.2 and up there is a sneakier way to do it that won't acquire any more lock than the statement-under-test does: begin; update pg_index set indisvalid = false where indexrelid = 'soandso'::regclass; explain analyze ...; rollback; regards, tom lane