Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 116804760CE for ; Thu, 16 Jan 2003 12:52:50 -0500 (EST) Received: from davinci.ethosmedia.com (unknown [209.10.40.251]) by postgresql.org (Postfix) with ESMTP id 61A734767DA for ; Thu, 16 Jan 2003 12:52:39 -0500 (EST) Received: from [63.195.55.98] (account ) by davinci.ethosmedia.com (CommuniGate Pro WebUser 4.0.2) with HTTP id 2316240; Thu, 16 Jan 2003 09:52:47 -0800 From: "Josh Berkus" Subject: Re: 7.3.1 New install, large queries are slow To: Tom Lane , "Josh Berkus" Cc: "Roman Fail" , sszabo@megazone23.bigpanda.com, pgsql-performance@postgresql.org X-Mailer: CommuniGate Pro Web Mailer v.4.0.2 Date: Thu, 16 Jan 2003 09:52:47 -0800 Message-ID: In-Reply-To: <16505.1042738209@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 8bit X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200301/164 X-Sequence-Number: 811 Tom, > The list of explicit JOINs as you have here is a good way to proceed > *if* you write the JOINs in an appropriate order for implementation. > I believe the problem with Roman's original query was that he listed > the JOINs in a bad order. Unfortunately I didn't keep a copy of that > message, and the list archives seem to be a day or more behind... > but at least for these WHERE conditions, it looks like the best bet > would to join m to b (I'm assuming m.merchid is unique), then to t, > then to d, then add on the others. I realize that I've contributed nothing other than bug reports to the parser design. But shouldn't Postgres, given a free hand, figure out the above automatically? I'd be embarassed if MS could one-up us in parser planning anywhere, theirs sucks on sub-selects .... -Josh Berkus