Re: Finding matching ranges

From: JRStern <JRStern_at_gte.net>
Date: Thu, 07 Jun 2001 18:11:02 GMT
Message-ID: <3b1fc42c.9648133_at_news.gte.net>


On 07 Jun 2001 16:15:14 +0200, Martin Drautzburg <drautzburg_at_altavista.net> wrote:
>I was wondering If I could use a redundant column "g" to speed things
>up. Ideally I would transform the problem
> x < given Value < y
>
>to something like
> f1(givenValue) < g(x,y) < f2(givenValue).
>
>This would reduce the problem to a simple range scan on the redundant
>column g(x,y). But I have no idea what functions f1, f2 and g to use
>(apart from the obvious trivial solution f1=0, g=1, f2=2, which would
>be logically correct, but would provide absolutely no selectivity).

You're probably best off letting the computer earn its keep. Buy some more RAM if you must. End of problem, for the most part.

But for data warehouse kinds of apps, it makes sense to use materialized views for heavily accessed ranges -- basically your g(x,y) is defined by a view. Or do it the old-fashioned way, just create a new table for each g(), write into that table only the keys for records that fit the range.

Joshua Stern
JRStern_at_gte.net Received on Thu Jun 07 2001 - 20:11:02 CEST

Original text of this message