Received: from localhost (mx1.hub.org [200.46.208.251]) by postgresql.org (Postfix) with ESMTP id 13CF59FA4A7 for ; Mon, 9 Oct 2006 00:03:43 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) with ESMTP id 30282-04 for ; Mon, 9 Oct 2006 00:03:37 -0300 (ADT) X-Greylist: delayed 00:57:20.130392 by SQLgrey- Received: from svr4.postgresql.org (svr4.postgresql.org [66.98.251.159]) by postgresql.org (Postfix) with ESMTP id E80A99FB42E for ; Mon, 9 Oct 2006 00:01:12 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.3 Received: from noel.decibel.org (noel.decibel.org [67.100.216.10]) by svr4.postgresql.org (Postfix) with ESMTP id 0FBD95AF952 for ; Sun, 8 Oct 2006 20:35:14 +0000 (GMT) Received: by noel.decibel.org (Postfix, from userid 1001) id 2459D56427; Sun, 8 Oct 2006 15:34:52 -0500 (CDT) Received: (hashcash-sendmail, from uid 1001); Sun, 8 Oct 2006 15:34:50 -0500 Date: Sun, 8 Oct 2006 15:34:50 -0500 From: "Jim C. Nasby" To: Merlin Moncure Cc: Carlo Stonebanks , pgsql-performance@postgresql.org Subject: Re: Performance Optimization for Dummies 2 - the SQL Message-ID: <20061008203450.GK72517@nasby.net> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Operating-System: FreeBSD 6.0-RELEASE-p4 amd64 X-Distributed: Join the Effort! http://www.distributed.net User-Agent: Mutt/1.5.11 X-Hashcash: 1:20:061008:mmoncure@gmail.com::nz9Bp9XnViNO8RJB:0000000000000000000 0000000000000000000000008EzF X-Hashcash: 1:20:061008:stonec.register@sympatico.ca::TLB6b8BvD9bZO+mj:000000000 0000000000000000000000007EAH X-Hashcash: 1:20:061008:pgsql-performance@postgresql.org::T2XDRIY5Xtg6ELwu:00000 00000000000000000000000021kt X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.054 tagged_above=0 required=5 tests=AWL X-Spam-Level: X-Archive-Number: 200610/150 X-Sequence-Number: 21279 On Thu, Oct 05, 2006 at 09:30:45AM -0400, Merlin Moncure wrote: > I personally only use explicit joins when doing outer joins and even > them push them out as far as possible. I used to be like that too, until I actually started using join syntax. I now find it's *way* easier to identify what the join conditions are, and to seperate them from the rest of the where clause. It also makes it pretty much impossible to mess up a join clause and get a cartesian product. If you are going to put the join clauses in the WHERE clause, at least put a space between the join stuff and the rest of the WHERE clause. In any case, this is nothing but a matter of taste in this case, unless you set join_collapse_limit to less than 3 (or maybe 4). -- Jim Nasby jim@nasby.net EnterpriseDB http://enterprisedb.com 512.569.9461 (cell)