Received: from localhost (unknown [200.46.204.187]) by postgresql.org (Postfix) with ESMTP id 596659FB7AD for ; Thu, 6 Sep 2007 19:15:35 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.187]) (amavisd-maia, port 10024) with ESMTP id 25681-03 for ; Thu, 6 Sep 2007 19:14:42 -0300 (ADT) Received: from mx1.hub.org (mx1.hub.org [200.46.208.251]) by postgresql.org (Postfix) with ESMTP id 4B4189FB7AE for ; Thu, 6 Sep 2007 19:14:44 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.5 Received: from lists.commandprompt.com (host-254.commandprompt.net [207.173.203.254]) by mx1.hub.org (Postfix) with ESMTP id EDA57609397 for ; Thu, 6 Sep 2007 19:14:38 -0300 (ADT) Received: from perhan.alvh.no-ip.org (190-13-142-51.bk13-dsl.surnet.cl [190.13.142.51]) (authenticated bits=0) by lists.commandprompt.com (8.13.7/8.13.6) with ESMTP id l86M9g5p010803; Thu, 6 Sep 2007 15:09:43 -0700 Received: by perhan.alvh.no-ip.org (Postfix, from userid 1000) id 2883B47C62; Thu, 6 Sep 2007 18:09:40 -0400 (CLT) Date: Thu, 6 Sep 2007 18:09:40 -0400 From: Alvaro Herrera To: Patric Cc: pgsql-performance@postgresql.org Subject: Re: Reasonable amount of indices Message-ID: <20070906220940.GN8709@alvh.no-ip.org> References: <46E05E4D.3010003@p-dw.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <46E05E4D.3010003@p-dw.com> User-Agent: Mutt/1.5.16 (2007-06-11) X-Virus-Scanned: ClamAV 0.91.1/4170/Wed Sep 5 21:30:09 2007 on projects.commandprompt.com X-Virus-Status: Clean X-Greylist: Sender succeded SMTP AUTH authentication, not delayed by milter-greylist-1.6 (lists.commandprompt.com [192.168.2.159]); Thu, 06 Sep 2007 15:09:44 -0700 (PDT) X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200709/103 X-Sequence-Number: 26648 Patric wrote: > My Question now is: Is it wise to do so, and create hundreds or maybe > thousands of Indices > which partition the table for the selections. No, this is not helpful -- basically what you are doing is taking the first level (the first couple of levels maybe) of the index out of it, and charging the planner with the selection of which one is the best for each query. Of course, I am assuming you were simplifing your queries and don't actually store the name of the continent etc on each on every row. Because if you actually do that, then there's your first oportunity for actual optimization (which happens to be a more normalized model), far more effective than the partial indexes you are suggesting. -- Alvaro Herrera http://www.CommandPrompt.com/ The PostgreSQL Company - Command Prompt, Inc.