X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 85A4152820 for ; Wed, 1 Jun 2005 23:05:37 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 12818-08 for ; Thu, 2 Jun 2005 02:05:36 +0000 (GMT) Received: from exobox.exoweb.net (unknown [221.122.43.98]) by svr1.postgresql.org (Postfix) with SMTP id DA0CE52819 for ; Wed, 1 Jun 2005 23:05:27 -0300 (ADT) Received: (qmail 14471 invoked from network); 2 Jun 2005 02:05:28 -0000 Received: from exo185.exoweb.net (HELO tobias.nordicbet.invalid) (192.168.0.185) by 0 with SMTP; 2 Jun 2005 02:05:28 -0000 Received: by tobias.nordicbet.invalid (Postfix, from userid 500) id 4C509E09C7; Thu, 2 Jun 2005 10:05:28 +0800 (CST) Date: Thu, 2 Jun 2005 10:05:28 +0800 From: Tobias Brox To: pgsql-performance@postgresql.org Subject: Forcing use of specific index Message-ID: <20050602020528.GL26100@tobias.exoweb.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Organization: Group Nordicbet User-Agent: Mutt/1.5.6i X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests= X-Spam-Level: X-Archive-Number: 200506/22 X-Sequence-Number: 12660 Is it any way to attempt to force the planner to use some specific index while creating the plan? Other than eventually dropping all the other indices (which is obiously not a solution in production setting anyway)? I have one case where I have added 16 indices to a table, many of them beeing partial indices. The table itself has only 50k of rows, but are frequently used in heavy joins. I imagine there can be exponential order on the number of alternative paths the planner must examinate as function of the number of indices? It seems to me that the planner is quite often not choosing the "best" index, so I wonder if there is any easy way for me to check out what the planner think about a specific index :-) -- Tobias Brox, Beijing