X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 98EFE535B3 for ; Mon, 4 Apr 2005 01:50:20 +0100 (BST) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 12254-07 for ; Mon, 4 Apr 2005 00:50:11 +0000 (GMT) Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by svr1.postgresql.org (Postfix) with ESMTP id 25C015359D for ; Mon, 4 Apr 2005 01:50:10 +0100 (BST) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.13.1/8.13.1) with ESMTP id j340oCUc013637; Sun, 3 Apr 2005 20:50:12 -0400 (EDT) To: PFC Cc: _moray , pgsql-sql@postgresql.org Subject: Re: a very big table In-reply-to: References: Comments: In-reply-to PFC message dated "Sun, 03 Apr 2005 20:21:57 +0200" Date: Sun, 03 Apr 2005 20:50:12 -0400 Message-ID: <13636.1112575812@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.006 tagged_above=0 required=5 tests=AWL X-Spam-Level: X-Archive-Number: 200504/39 X-Sequence-Number: 20932 PFC writes: > Here you don't need to LEFT JOIN, you can use a straight simple > unconstrained join because the rows generated by the LEFT JOINs which have > NULL in the right columns will be rejected by the WHERE clause anyway : In recent versions of Postgres, the planner knows this and can make the simplification for itself, at least if the operator or function used in WHERE is properly marked as strict. regards, tom lane