mikharakiri (AT) yahoo (DOT) com (Mikito Harakiri) writes:
Quote:
That's right: recursive view means that given temporary table state
T(N) at the step N we calculate T(N+1)
which means that temporary table is totally rewritten at each step
rather than incrementally inflated as Graeme suggests.
Am I missing some kind of optimization that reduces my execution to
Graeme's? (My guess would be that not every kind of recursive union
view would allow such transformation.) |
First, you are confusing the language semantics with the evaluation
procedure. The semantics of the recursive view is the view instance
corresponding to T(n) where n is the least positive integer for which
T(n) = T(n+1). This is called the least fixed point of the query.
At step N you calculate T(N+1). If you compute T(N+1) from scratch,
it is called naive evaluation. For some queries, including all linear
recursive queries, you can do semi-naive evaluation which incorporates
the optimization of just computing the delta between T(N) and T(N+1) and
adding that into the temporary table for T(N) to get T(N+1).
Hope that helps.
Joseph