Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 6BFFE47618E for ; Thu, 21 Nov 2002 14:45:16 -0500 (EST) Received: from sss.pgh.pa.us (unknown [192.204.191.242]) by postgresql.org (Postfix) with ESMTP id 4A3E247603C for ; Thu, 21 Nov 2002 14:45:14 -0500 (EST) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.12.6/8.12.6) with ESMTP id gALJjBsX013940; Thu, 21 Nov 2002 14:45:11 -0500 (EST) To: "Marc Mitchell" Cc: pgsql-admin@postgresql.org Subject: Re: Query performanc issue - too many table? In-reply-to: <005501c2917f$61ca09a0$7c01050a@marcmdelltop> References: <005501c2917f$61ca09a0$7c01050a@marcmdelltop> Comments: In-reply-to "Marc Mitchell" message dated "Thu, 21 Nov 2002 10:59:40 -0600" Date: Thu, 21 Nov 2002 14:45:11 -0500 Message-ID: <13938.1037907911@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200211/196 X-Sequence-Number: 6384 "Marc Mitchell" writes: > I am having a problem with the below SQL taking an extreme amount of time > to run. The problem is that the explain looks great with all index scans. > But the query itself takes minutes to run. The query contains 11 tables. > We've found that by dropping any one table, performance reverts to being > nearly instantaneous. 11 tables is the default GEQO threshold, so I'm wondering if the GEQO planner is missing the best plan. It's hard to tell much though without seeing plans for *both* queries you are comparing. EXPLAIN ANALYZE output would be much more useful than just EXPLAIN, too. regards, tom lane