Received: from localhost (maia-4.hub.org [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id B5F1F9FB4B9 for ; Tue, 20 Feb 2007 00:54:11 -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 27370-03 for ; Tue, 20 Feb 2007 00:54:09 -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 E14609FB44D for ; Tue, 20 Feb 2007 00:54:08 -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 l1K4s84v019845; Mon, 19 Feb 2007 23:54:08 -0500 (EST) To: Reinhard Vicinus cc: pgsql-performance@postgresql.org Subject: Re: Query Optimization In-reply-to: <45D9D85A.3090000@rjm.de> References: <45D9D85A.3090000@rjm.de> Comments: In-reply-to Reinhard Vicinus message dated "Mon, 19 Feb 2007 18:03:22 +0100" Date: Mon, 19 Feb 2007 23:54:08 -0500 Message-ID: <19844.1171947248@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.065 tagged_above=0 required=5 tests=AWL, BAYES_50, SPF_HELO_PASS, SPF_PASS X-Spam-Level: X-Archive-Number: 200702/197 X-Sequence-Number: 23251 Reinhard Vicinus writes: > PostgreSQL version: 8.1.6 > The following query needs a lot of time because the query planner > reorders the joins: Try reducing random_page_cost, increasing effective_cache_size, and/or updating to PG 8.2. Any of these are likely to make it like the nestloop plan better... regards, tom lane