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!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

Analyze materialized view

user3636719Aug 22 2011 — edited Aug 22 2011
I just created materialized view; do I need to analyze materialized view after it got created? If yes, how it is going to impact performance.
This post has been answered by sb92075 on Aug 22 2011
Jump to Answer

Comments

sb92075
user3636719 wrote:
I just created materialized view; do I need to analyze materialized view after it got created? If yes, how it is going to impact performance.
answer is version dependent & the plans for this new object.

do as below so we can know complete Oracle version & OS name.

Post via COPY & PASTE complete results of
SELECT * from v$version;
Tubby
user3636719 wrote:
I just created materialized view; do I need to analyze materialized view after it got created? If yes, how it is going to impact performance.
Only you can answer that question based on YOUR systems needs (why did you create the MV?). But you'll need to do some reading before you make that assessment.

http://download.oracle.com/docs/cd/E11882_01/server.112/e16579/qradv.htm#DWHSG8577
http://download.oracle.com/docs/cd/E11882_01/server.112/e16579/qradv.htm#DWHSG08011

Should be useful starters.
Iordan Iotzov
Unless you are planning to use dynamic sampling with that materialized view, you need to gather stats sooner than later. You (or the default stats gathering) would need to gather stats every time the volume or distribution in that MV changes significantly. Proper statistics are essential for achieving good performance.


Iordan Iotzov
http://iiotzov.wordpress.com/
user3636719
select * from v$version;

Oracle Database 10g Enterprise Edition Release 10.2.0.5.0 - 64bi
PL/SQL Release 10.2.0.5.0 - Production
"CORE	10.2.0.5.0	Production"
TNS for HPUX: Version 10.2.0.5.0 - Production
NLSRTL Version 10.2.0.5.0 - Production
sb92075
Answer
user3636719 wrote:
select * from v$version;

Oracle Database 10g Enterprise Edition Release 10.2.0.5.0 - 64bi
PL/SQL Release 10.2.0.5.0 - Production
"CORE	10.2.0.5.0	Production"
TNS for HPUX: Version 10.2.0.5.0 - Production
NLSRTL Version 10.2.0.5.0 - Production
default V10 behavior is for statistics to be gathered once every 24 hours.
so if you do nothing, the MV will have stats by tomorrow at this time
Marked as Answer by user3636719 · Sep 27 2020
user3636719
Only you can answer that question based on YOUR systems needs (why did you create the MV?)
The reason behind creating materialized view is; there is select statement which user to take 2 to 3 hours for running and developers need results just ones in two months so instead of tuning it we came up the idea of creating materialized view. And this materialized view gets refreshed after every two months. I am not sure if we did the right thing.
CREATE MATERIALIZED VIEW LLNK.MVW_SAMPLE      NOCOMPRESS 
                                               NOLOGGING 
                                               TABLESPACE SAMPLE_DATA_TS 
                                               BUILD IMMEDIATE USING INDEX 
                                               REFRESH FORCE ON DEMAND START WITH sysdate+0 NEXT SYSDATE + 60 
  AS
  SELECT Name FOLDERNAME FROM EMP;
JustinCave
Are you really doing a straight SELECT with no WHERE clause and no aggregation in your materialized view? If so, why would it be more efficient to read N rows from your materialized view than to read N rows from your base table? If you're just eliminating some columns, it would probably be easier to do a full scan on an index on the NAME column.

Justin
user3636719
Are you really doing a straight SELECT with no WHERE clause and no aggregation in your materialized view? If so, why would it be more efficient to read N rows from your materialized view than to read N rows from your base table? If you're just eliminating some columns, it would probably be easier to do a full scan on an index on the NAME column.
No, there is a where clause in the view. That is just a head for materialized view.
665655
I analyzing mview won't impact the performance of the system(assuming that is not highly active database). It would use some resources to gather the statistics .

Thanks!
KR
Hemant K Chitale
there is select statement which user to take 2 to 3 hours for running and developers need results just ones in two months
If you need to run a query only once in 2 months (and it takes 3hours to run), your developer loses a max of 3 hours in 40 working days.
Does that justify creating a Materialized View ?

Hemant K Chitale
1 - 10
Locked Post
New comments cannot be posted to this locked post.

Post Details

Locked on Sep 19 2011
Added on Aug 22 2011
10 comments
1,283 views