Received: from maia.hub.org (maia-2.hub.org [200.46.204.251]) by mail.postgresql.org (Postfix) with ESMTP id E690063229F for ; Mon, 10 May 2010 17:11:42 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.251]) (amavisd-maia, port 10024) with ESMTP id 83001-08 for ; Mon, 10 May 2010 20:11:31 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by mail.postgresql.org (Postfix) with ESMTP id A296E6326AD for ; Mon, 10 May 2010 17:11:31 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.2/8.14.2) with ESMTP id o4AKBQ0H016631; Mon, 10 May 2010 16:11:26 -0400 (EDT) To: Gerardo Herzig cc: postgres list Subject: Re: advice on query joining 10 tables In-reply-to: <4BE8530C.6030605@fmed.uba.ar> References: <4BE8530C.6030605@fmed.uba.ar> Comments: In-reply-to Gerardo Herzig message dated "Mon, 10 May 2010 15:40:12 -0300" Date: Mon, 10 May 2010 16:11:25 -0400 Message-ID: <16630.1273522285@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.91 tagged_above=-5 required=5 tests=BAYES_00=-1.9, T_RP_MATCHES_RCVD=-0.01 X-Spam-Level: X-Archive-Number: 201005/34 X-Sequence-Number: 34082 Gerardo Herzig writes: > Hi all. Im triyng to see if i can improve the performance of a query > (mainly a 10 table join) One easy thing to try is increase from_collapse_limit and/or join_collapse_limit to 10 or more. That will result in longer planning time but might let the planner find a better plan for this query. regards, tom lane