"Qingqing Zhou" <zhouqq(at)cs(dot)toronto(dot)edu> writes:
> "Robert Edmonds" <edmonds42(at)bellsouth(dot)net> wrote
>> Instead of specifying explicit address ranges in the query, I'd like
>> to store the ranges in a table:
> Good illustration. I guess we have a problem of the historgram statistical
> information.
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.
regards, tom lane