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 77918329EA5 for ; Tue, 21 Sep 2004 07:24:52 +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 68365-07 for ; Tue, 21 Sep 2004 06:24:42 +0000 (GMT) Received: from fw1.mailpen.net (fw1.mailpen.net [66.13.45.202]) by svr1.postgresql.org (Postfix) with ESMTP id 4E126329E15 for ; Tue, 21 Sep 2004 07:24:42 +0100 (BST) Received: from TpA22p1.ultimeth.com (TpA22p1.internal.mailpen.net [192.168.128.199]) (using SSLv3 with cipher DES-CBC3-SHA (168/168 bits)) (No client certificate requested) by fw1.mailpen.net (Postfix) with ESMTP id 4BF8531C01E; Mon, 20 Sep 2004 23:24:42 -0700 (PDT) Message-Id: <5.1.0.14.2.20040920231140.00ae4828@imaps.mailpen.net> X-Sender: mailer@postgresql3.ultimeth.com (Unverified) X-Mailer: QUALCOMM Windows Eudora Version 5.1 Date: Mon, 20 Sep 2004 23:24:39 -0700 To: pgsql-sql@postgresql.org From: "Dean Gibson (DB Administrator)" Subject: Re: JOIN performance Cc: pgsql-sql@postgresql.org In-Reply-To: <25938.1095743973@sss.pgh.pa.us> References: <5.1.0.14.2.20040920213442.00ae4450@imaps.mailpen.net> <5.1.0.14.2.20040920182022.00adf5e8@imaps.mailpen.net> <5.1.0.14.2.20040920164348.00a99868@imaps.mailpen.net> <5.1.0.14.2.20040920121606.00a89c68@imaps.mailpen.net> <414F02FF.8000603@numerixtechnology.de> <414F02FF.8000603@numerixtechnology.de> <5.1.0.14.2.20040920121606.00a89c68@imaps.mailpen.net> <5.1.0.14.2.20040920164348.00a99868@imaps.mailpen.net> <5.1.0.14.2.20040920182022.00adf5e8@imaps.mailpen.net> <5.1.0.14.2.20040920213442.00ae4450@imaps.mailpen.net> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; format=flowed X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.0 tagged_above=0.0 required=5.0 tests= X-Spam-Level: X-Archive-Number: 200409/228 X-Sequence-Number: 19074 Tom Lane wrote on 2004-09-20 22:19: >In 7.3 only a view whose targetlist consists of simple column references >can be pulled up into the nullable side of an outer join. OK, well you dragged me kicking and screaming into writing and 'end_date' function (IMMUTABLE but non-STRICT). I then use that in the JOINed VIEW (and other strategic places) rather than in the subject of the LEFT JOIN, and that works with no performance problems. Since we mentioned PostgreSQL versions, one of the things I'd like to see in v8.0 is support for "DELETE FROM ... AS ..." and "UPDATE ... AS ...". For example, I need to do things like: DELETE FROM xxx AS x WHERE field > xxx.field; In other words, a DELETE that has criteria similar to a self JOIN. Right now, I do this via: CREATE VIEW yyy AS SELECT * FROM xxx; DELETE FROM xxx WHERE field > yyy.field; And that works fine. But it's probably too late for v8.0 ... -- Dean