materialized view with nologging [message #561294] |
Fri, 20 July 2012 05:09  |
 |
guddu_12
Messages: 227 Registered: April 2012 Location: UK
|
Senior Member |
|
|
Dear All,
I have a live OLTP system where i have delived a solution for performance tunning , as a part of performance tunning i have created a MV which as below. I have created MV with no logging option as this will be refreshed at 3 min interval. i have compared the AWR report prior to deploy MV and after deployment. After deployment it have increased the redo by 4 times. Is there any way i can reduce the redo and what is wrong with mv with nologging.
CREATE MATERIALIZED VIEW "OVSD"."GSP_RELATEDEVENTS1"
NOLOGGING
REFRESH FORCE
--START WITH SYSDATE NEXT SYSDATE + 3/1440
AS
SELECT DISTINCT ser_id AS R_SER_ID,
WM_CONCAT (REL_NAME) AS R_NAME
FROM sd_servicecalls,
cdm_serv_evt_relations,
GSP_EVENTS
WHERE sre_from = ser_oid
AND sre_to = EVENT_TO_OID
GROUP BY ser_id;
ALTER MATERIALIZED VIEW "OVSD"."GSP_RELATEDEVENTS1" COMPILE;
drop materialized view GSP_RELATEDEVENTS1;
create index ser_id_mv_idx on GSP_RELATEDEVENTS1(r_ser_id);
analyze table GSP_RELATEDEVENTS1 compute statistics
any help will be appriciated
|
|
|
|
|
Re: materialized view with nologging [message #561303 is a reply to message #561300] |
Fri, 20 July 2012 06:26   |
John Watson
Messages: 8966 Registered: January 2010 Location: Global Village
|
Senior Member |
|
|
Quote:nologging can't reduce the redo? No.
You need an MV that is fast refreshable, which will never work with your query. Why do you have both DISTINCT and GROUP BY? Why do you have either? Your use of column aliases will cripple the query re-write capability. You will need the ROWIDs in the view and the logs.
There are many restrictions on materialized views with both joins and aggregates. If a three minute refresh is necessary for a complex view, I suspect you may have chosen the wrong solution to the problem. Sorry not to be more positive.
|
|
|
|
Re: materialized view with nologging [message #561324 is a reply to message #561306] |
Fri, 20 July 2012 08:47   |
 |
Michel Cadot
Messages: 68737 Registered: March 2007 Location: Saint-Maur, France, https...
|
Senior Member Account Moderator |
|
|
First you have to understand the SQL you write.
To use DISTINCT with GROUP BY is a silly thing. If you use GROUP BY then all rows are distinct, otherwise this means that 2 rows are not grouped.
Then NEVER use ANALYZE to gather statistics, use DBMS_STATS.
Regards
Michel
[Updated on: Fri, 20 July 2012 08:49] Report message to a moderator
|
|
|
|
|
|