Re: Broken selectivity with special inet operators - Mailing list pgsql-bugs

From Tom Lane
Subject Re: Broken selectivity with special inet operators
Date
Msg-id 5458.1316652483@sss.pgh.pa.us
Whole thread Raw
In response to Re: Broken selectivity with special inet operators  (Josh Berkus <josh@agliodbs.com>)
Responses Re: Broken selectivity with special inet operators  (Josh Berkus <josh@agliodbs.com>)
List pgsql-bugs
Josh Berkus <josh@agliodbs.com> writes:
>> 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.

> If we can estimate the cost of the indexscan, why can't we estimate the
> rowcount?

Because the estimated rowcount is derived long before we consider whether
to use an indexscan at all, and indeed must be computable whether the
table has any related index or not.  The special-indexscan-qual code is
*not* a substitute for providing a selectivity estimator.

It's possible that we could build simple estimators for these operators
that just turn the problem into a range estimation and then pass it off
to somewhere else, but nobody has tried.

            regards, tom lane

pgsql-bugs by date:

Previous
From: Josh Berkus
Date:
Subject: Re: Broken selectivity with special inet operators
Next
From: Josh Berkus
Date:
Subject: Re: Broken selectivity with special inet operators