X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by postgresql.org (Postfix) with ESMTP id 5BEB79DC854 for ; Sun, 15 Jan 2006 19:32:05 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 80081-09 for ; Sun, 15 Jan 2006 19:32:05 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey- Received: from mail.mailpen.net (mail.mailpen.net [66.235.70.248]) by postgresql.org (Postfix) with ESMTP id 8C6CA9DC816 for ; Sun, 15 Jan 2006 19:32:00 -0400 (AST) Received: from athlon1.internal.mailpen.net (pool-71-113-18-74.sttlwa.dsl-w.verizon.net [71.113.18.74]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.mailpen.net (Postfix) with ESMTP id 3627217 for ; Sun, 15 Jan 2006 15:32:03 -0800 (PST) Received: from [192.168.128.199] (TpA22p1.internal.mailpen.net [192.168.128.199]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by athlon1.internal.mailpen.net (Postfix) with ESMTP id 2EB506DC060 for ; Sun, 15 Jan 2006 15:32:02 -0800 (PST) Message-ID: <43CADB5C.3020302@ultimeth.com> Date: Sun, 15 Jan 2006 15:31:40 -0800 From: "Dean Gibson (DB Administrator)" Organization: UltiMeth Systems User-Agent: Thunderbird 1.5 (Windows/20051201) MIME-Version: 1.0 To: pgsql-sql Subject: Re: What does "merge-joinable join conditions" mean ???? References: <43CAAFA6.6050001@ultimeth.com> <20060115215448.GA30809@winnie.fuhr.org> <43CACC78.7090107@ultimeth.com> <24299.1137367313@sss.pgh.pa.us> In-Reply-To: <24299.1137367313@sss.pgh.pa.us> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0.12 required=5 tests=[AWL=0.120] X-Spam-Score: 0.12 X-Spam-Level: X-Archive-Number: 200601/84 X-Sequence-Number: 23873 On 2006-01-15 15:21, Tom Lane wrote: > Really? The FULL JOIN condition using ~ is the source of the failure, and I'd be quite surprised if changing WHERE makes it work. > Works fine: EXPLAIN SELECT count(*) FROM "Extra" FULL JOIN "GeoRestrict" ON callsign ~ pattern WHERE geo_region = 4; QUERY PLAN --------------------------------------------------------------------------------- Aggregate (cost=1934.02..1934.02 rows=1 width=0) -> Nested Loop Left Join (cost=1.18..1926.66 rows=2943 width=0) Join Filter: ("outer".callsign ~ ("inner".pattern)::text) -> Seq Scan on "Extra" (cost=0.00..866.00 rows=2943 width=10) Filter: (geo_region = 4) -> Materialize (cost=1.18..1.34 rows=16 width=7) -> Seq Scan on "GeoRestrict" (cost=0.00..1.16 rows=16 width=7) Note that this used to be just a LEFT JOIN (which also worked), but today I wanted to include rows from "GeoRestrict" that had nulls for the left-hand-side of the query, so I changed the LEFT JOIN to a FULL JOIN (that worked), and then attempted to add a condition to restrict which rows were included from "GeoRestrict", and that gave the error. -- Dean