Re: How to implement query rewriting?
Date: 23 Oct 2000 13:04:03 GMT
Message-ID: <8t1d03$oq5$1_at_news.tue.nl>
Kai Großjoha nn wrote:
> I have designed a query language and a logical algebra for it. I have
> a program which converts a query into the logical algebra. I'm in the
> process of defining the operators of the physical algebra.
>
> The question now is: how to transform the query from a logical algebra
> expression into a physical algebra expression?
The nice thing about the Prolog approach is that you have an explicit representation for the rules that determine how the logical algebra is translated to the physical algebra. The nice thing about this is that your program will be easy to extend if the physical algebra is extended or if you think of better rules.
For starters you could simply translate every logical operator to one physical operator.
> PS: I know that query optimization is something I need to look at, but
> to keep it simple I'll be happy if I get any physical algebra
> expression at all, it need not be efficient.
In theory query optimization is often split in two steps: first you optimize the logical expression, and second you choose the physical expressions. Usually the second step doesn't involve a lot of rewriting. So I would first implement the second step. If that works then I would start thinking about doing optimization in the first step.
-- Kind regards, Jan HiddersReceived on Mon Oct 23 2000 - 15:04:03 CEST