Received: from maia.hub.org (maia-3.hub.org [200.46.204.243]) by mail.postgresql.org (Postfix) with ESMTP id 58F39B5DC01 for ; Wed, 21 Sep 2011 18:18:01 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.243]) (amavisd-maia, port 10024) with ESMTP id 56495-06 for ; Wed, 21 Sep 2011 21:17:54 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.8.0-rc2 Received: from smtp-out-1.01.com (smtp.01.com [216.115.88.169]) by mail.postgresql.org (Postfix) with ESMTP id 80306B5DC22 for ; Wed, 21 Sep 2011 18:17:54 -0300 (ADT) Received: from localhost (localhost.localdomain [127.0.0.1]) by smtp-out-1.01.com (Postfix) with ESMTP id 467819D0DC0 for ; Wed, 21 Sep 2011 16:17:54 -0500 (CDT) X-Virus-Scanned: amavisd-new at smtp-out-1.01.com Received: from smtp-out-1.01.com ([127.0.0.1]) by localhost (smtp-out-1.01.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id mJu3EnOpAvTH for ; Wed, 21 Sep 2011 16:17:54 -0500 (CDT) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp-out-1.01.com (Postfix) with ESMTP id 0FBA39D0DC1 for ; Wed, 21 Sep 2011 16:17:54 -0500 (CDT) Received: from Sidney-Stratton.local (70-36-143-92.dsl.dynamic.sonic.net [70.36.143.92]) by smtp-out-1.01.com (Postfix) with ESMTPSA id C3ADD9D0DB8; Wed, 21 Sep 2011 16:17:53 -0500 (CDT) Message-ID: <4E7A547C.40700@agliodbs.com> Date: Wed, 21 Sep 2011 14:17:48 -0700 From: Josh Berkus Organization: PostgreSQL Experts Inc. User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9.2.15) Gecko/20110303 Lightning/1.0b2 Thunderbird/3.1.9 MIME-Version: 1.0 To: Tom Lane CC: pgsql-bugs@postgresql.org Subject: Re: Broken selectivity with special inet operators References: <4E7A4923.1020900@agliodbs.com> <29153.1316638577@sss.pgh.pa.us> In-Reply-To: <29153.1316638577@sss.pgh.pa.us> X-Enigmail-Version: 1.1.1 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.9 tagged_above=-5 required=5 tests=BAYES_00=-1.9 X-Spam-Level: X-Archive-Number: 201109/145 X-Sequence-Number: 31162 On 9/21/11 1:56 PM, Tom Lane wrote: > Josh Berkus writes: >> Summary: special inet operators ( << >> <<= =>> ) are >> up to 1000000X off in estimating rowcounts > > A look in pg_operator will show you that these operators have no > associated selectivity estimators at all. It's not so much "broken" > as "unimplemented". Oh! I was assuming that the special case code kicked in regardless. So we implemented the rewrite to < and > for the actual execution, but not for cost estimates? -- Josh Berkus PostgreSQL Experts Inc. http://pgexperts.com