X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 8F96DD6822 for ; Wed, 2 Nov 2005 00:20:55 -0400 (AST) 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 48324-10 for ; Wed, 2 Nov 2005 04:20:54 +0000 (GMT) Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by svr1.postgresql.org (Postfix) with ESMTP id 17952D680A for ; Wed, 2 Nov 2005 00:20:53 -0400 (AST) 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 jA24Kqu8001208; Tue, 1 Nov 2005 23:20:52 -0500 (EST) To: "Qingqing Zhou" Cc: pgsql-performance@postgresql.org Subject: Re: performance of implicit join vs. explicit conditions on inet queries? In-reply-to: References: <20051024035809.GA18261@edmonds.ath.cx> <29864.1130768650@sss.pgh.pa.us> Comments: In-reply-to "Qingqing Zhou" message dated "Tue, 01 Nov 2005 20:19:37 -0500" Date: Tue, 01 Nov 2005 23:20:52 -0500 Message-ID: <1207.1130905252@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0.006 required=5 tests=[AWL=0.006] X-Spam-Score: 0.006 X-Spam-Level: X-Archive-Number: 200511/22 X-Sequence-Number: 15279 "Qingqing Zhou" writes: > "Tom Lane" wrote >> No, that's completely irrelevant to his problem. The reason we can't do >> this is that the transformation from "x << const" to a range check on x >> is a plan-time transformation; there's no mechanism in place to do it >> at runtime. > Not quite understand, sorry ... > (1) For this query (in an as-is PG syntax, which find out all rectangles lie > in a given rectangle) : > SELECT r FROM all_rectangles > WHERE r << rectangle('(1,9),(9,1)'); No, you're thinking of the wrong << operator. The question was about the inet network inclusion operator. We have a special case in indxpath.c to transform "inetcol << inetconstant" into a range check on the inet variable, much like we can transform a left-anchored LIKE pattern into a range check on the text variable. regards, tom lane