Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id D72554753A1 for ; Thu, 16 Jan 2003 13:40:41 -0500 (EST) Received: from sss.pgh.pa.us (unknown [192.204.191.242]) by postgresql.org (Postfix) with ESMTP id B139A476547 for ; Thu, 16 Jan 2003 13:40:36 -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 h0GIeW5u026147; Thu, 16 Jan 2003 13:40:33 -0500 (EST) To: "Josh Berkus" Cc: "Roman Fail" , sszabo@megazone23.bigpanda.com, pgsql-performance@postgresql.org Subject: Re: 7.3.1 New install, large queries are slow In-reply-to: References: Comments: In-reply-to "Josh Berkus" message dated "Thu, 16 Jan 2003 09:52:47 -0800" Date: Thu, 16 Jan 2003 13:40:32 -0500 Message-ID: <26146.1042742432@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200301/165 X-Sequence-Number: 812 "Josh Berkus" writes: >> 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 believe it will. So far I've not seen an EXPLAIN from a query that was structured to give it a free hand. As noted elsewhere, the fact that we allow JOIN syntax to constrain the planner is a real pain if you are accustomed to databases that don't do that. On the other hand, it's a real lifesaver for people who need to pare the planning time for dozen-way joins; it was only a day or two back in this same mailing list that we last had a discussion about that end of the problem. So even though it started out as an implementation shortcut rather than an intended feature, I'm loathe to just disable the behavior entirely. regards, tom lane