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 52EF4DA827 for ; Tue, 1 Nov 2005 21:19:26 -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 79927-10 for ; Wed, 2 Nov 2005 01:19:22 +0000 (GMT) Received: from floppy.pyrenet.fr (news.pyrenet.fr [194.116.145.2]) by svr1.postgresql.org (Postfix) with ESMTP id 40740D783D for ; Tue, 1 Nov 2005 21:19:24 -0400 (AST) Received: by floppy.pyrenet.fr (Postfix, from userid 106) id 85F8A30EC7; Wed, 2 Nov 2005 02:19:27 +0100 (MET) From: "Qingqing Zhou" X-Newsgroups: pgsql.performance Subject: Re: performance of implicit join vs. explicit conditions on inet queries? Date: Tue, 1 Nov 2005 20:19:37 -0500 Organization: Hub.Org Networking Services Lines: 30 Message-ID: References: <20051024035809.GA18261@edmonds.ath.cx> <29864.1130768650@sss.pgh.pa.us> X-Complaints-To: usenet@news.hub.org X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.2180 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180 X-RFC2646: Format=Flowed; Original To: pgsql-performance@postgresql.org X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0.573 required=5 tests=[AWL=0.573] X-Spam-Score: 0.573 X-Spam-Level: X-Archive-Number: 200511/21 X-Sequence-Number: 15278 "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. This is not easy to fix, because the mechanism that's doing > it is primarily intended for LIKE/regex index optimization, and in that > case a runtime pattern might well not be optimizable at all. > 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)'); If there is a GiST/Rtree index associated with all_rectangles.r, how do optimizer estimate the cost to decide that we should use this index or not(then by a seqscan)? (2) Does your above explaination mean that we can't use GiST for a spatial join operation? Regards, Qingqing