Skip to Main Content

Oracle Database Discussions

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Elapsed time for materialized view vs Master table query

972355May 31 2013 — edited May 31 2013
Hello all ;

Small confusion about Elapsed time for materialized view vs Master table query

SQL> select count(*), sum(quan_sold), sum(amt_sold) from sales;
COUNT(*) SUM(QUAN_SOLD) SUM(AMT_SOLD)
6000000 12000000 720480000
Elapsed: 00:00:30.54
SQL> create materialized view mv1
2 enable query rewrite as
3 select count(*), sum(quan_sold), sum(amt_sold) from sales;
Materialized view created.
Elapsed: 00:00:01.45
SQL> select count(*), sum(quan_sold), sum(amt_sold) from sales;
COUNT(*) SUM(QUAN_SOLD) SUM(AMT_SOLD)
6000000 12000000 720480000
Elapsed: 00:00:00.01

Please see all three cases "Elapsed Time" ...

When comparing other cases.
1. My query takes long time(30.54) fetching data from sales
2. Creating materialized view takes less time (01:45) Why ?

Source : http://uhesse.com/2009/07/08/brief-introduction-into-materialized-views/
This post has been answered by unknown-7404 on May 31 2013
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jun 28 2013
Added on May 31 2013
3 comments
446 views