Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: materialized view for this?
Użytkownik wolfing1_at_yahoo.com napisał:
> version 9i
> Problem is, there's a lot of code already written, and originally I was
> thinking of making a materialized view and rewrite the code to use the
> MV instead of the tables. But I was wondering how flexible or smart is
> the query rewrite thing so maybe I don't have to change the code or not
> all of it...
> Like, how would it work if I had this:
> table1: a,b,c,d,e
> MView: select a,sum(b) x,sum(c) y,max(d) z from table1
>
> query: select a-4, sum(b)+sum(c),max(d) from table1 where e=10
> Will Oracle use MView here?
>
First, you must group by a, if you want this queries to work. If there are indexes on column a and e why bother with MView? Gathering statisticts would help too. Should work fast enough.
-- tomekbReceived on Tue Jan 11 2005 - 08:22:55 CST