Received: from maia.hub.org (maia-2.hub.org [200.46.204.251]) by mail.postgresql.org (Postfix) with ESMTP id 7DCD5B5DC15 for ; Wed, 21 Sep 2011 18:58:03 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.251]) (amavisd-maia, port 10024) with ESMTP id 80236-06 for ; Wed, 21 Sep 2011 21:57:55 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.8.0-rc2 Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by mail.postgresql.org (Postfix) with ESMTP id CF651B5DC29 for ; Wed, 21 Sep 2011 18:57:54 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.2/8.14.2) with ESMTP id p8LLvpBo000630; Wed, 21 Sep 2011 17:57:51 -0400 (EDT) To: Josh Berkus cc: pgsql-bugs@postgresql.org Subject: Re: Broken selectivity with special inet operators In-reply-to: <4E7A547C.40700@agliodbs.com> References: <4E7A4923.1020900@agliodbs.com> <29153.1316638577@sss.pgh.pa.us> <4E7A547C.40700@agliodbs.com> Comments: In-reply-to Josh Berkus message dated "Wed, 21 Sep 2011 14:17:48 -0700" Date: Wed, 21 Sep 2011 17:57:50 -0400 Message-ID: <629.1316642270@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-2.404 tagged_above=-5 required=5 tests=BAYES_00=-1.9, RP_MATCHES_RCVD=-0.504 X-Spam-Level: X-Archive-Number: 201109/148 X-Sequence-Number: 31165 Josh Berkus writes: > On 9/21/11 1:56 PM, Tom Lane wrote: >> 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? If you mean the indexscan optimization, we do know how to estimate the cost of the indexscans, because that depends mostly on the behavior of the added < or > condition(s). This does not imply knowing how to estimate the behavior of >>= itself. regards, tom lane