Received: from sss.sss.pgh.pa.us (sss.pgh.pa.us [209.114.166.2]) by hub.org (8.9.3/8.9.3) with ESMTP id LAA58411 for ; Wed, 14 Jul 1999 11:21:52 -0400 (EDT) (envelope-from tgl@sss.pgh.pa.us) Received: from sss.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.sss.pgh.pa.us (8.9.1/8.9.1) with ESMTP id LAA25666; Wed, 14 Jul 1999 11:20:38 -0400 (EDT) To: =?iso-8859-1?Q?J=E9rome=20Kn=F6bl?= cc: pgsql-sql@hub.org Subject: Re: [SQL] Prolem wiht long query? In-reply-to: Your message of Wed, 14 Jul 1999 14:31:09 +0000 <378C9F2D.495FB4A0@mandanet.ch> Date: Wed, 14 Jul 1999 11:20:38 -0400 Message-ID: <25664.931965638@sss.pgh.pa.us> From: Tom Lane =?iso-8859-1?Q?J=E9rome=20Kn=F6bl?= writes: > I have some trouble with a very long query. The amount of time taken by the optimizer goes up exponentially with the number of tables being joined. If you are using a pre-6.5 version of Postgres then I'd recommend updating to 6.5; its optimizer is considerably faster and less memory-hungry than prior releases. You could also try reducing the GEQO threshold, which is the number of tables at which the system stops trying to do exhaustive optimization and changes to a heuristic planning method. regards, tom lane