物化视图,对系统的增、删、改操作影响很大,有没有什么改善的措施??

[复制链接]
查看11 | 回复6 | 2009-3-2 15:42:53 | 显示全部楼层 |阅读模式
在系统中为了解决查询速度的问题,而建了几个物化视图,结果查询速度上去了,但增、删、改操作速度很慢,大家有什么好的办法吗?
由于系统需要实时响应又只能采用ON COMMIT刷新。
回复

使用道具 举报

千问 | 2009-3-2 15:42:53 | 显示全部楼层
鱼与熊掌是不能兼得的。。。。
本来物化视图就是以空间换时间的,当然有开销了。
回复

使用道具 举报

千问 | 2009-3-2 15:42:53 | 显示全部楼层
:(
回复

使用道具 举报

千问 | 2009-3-2 15:42:53 | 显示全部楼层
mv的刷新方法是什么?
回复

使用道具 举报

千问 | 2009-3-2 15:42:53 | 显示全部楼层
有没有设log?
回复

使用道具 举报

千问 | 2009-3-2 15:42:53 | 显示全部楼层
CREATEmaterialized VIEW MVTCUSERLESSONDEPT
build immediate refresh fast on commit enable query rewrite
AS
select tu.rowid turowid,u.rowid urowid,tc.rowid tcrowid,tl.rowid tlrowid,l.rowid lrowid,
u.ID UserID, u.name us_name, u.regname, tc.TC_ID ,tl.TL_ID,tl.LE_ID,tc.begindate createtime,
tc.TrainingForm,tc.TrainingFee,tc.otherFee,tl.fee,tu.Type,l.Hour,l.LE_NAME LessonName,l.le_name, l.le_code,
l.trainingtype,l.kj_type,l.allowday,l.status,tc.year,tc.tc_name,u.groupids, u.corpid, u.phone, u.email, u.business
from TC_User tu,Tuser u,TrainingClass tc,TC_Lesson tl,Lesson l
where tu.TC_ID = tc.TC_ID and tc.TC_ID=tl.TC_ID
and u.groupids like '%,,'||tu.entityID ||',,%'
and tu.Type=2
and u.WorkDate <= tc.Bm_enddate and tc.status = 1
and tl.LE_ID=l.le_ID
and tc.secondafter = 1 ;
回复

使用道具 举报

千问 | 2009-3-2 15:42:53 | 显示全部楼层
如果实时性要求不高的话,可以定期fresh , not immediate refresh !
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

主题

0

回帖

4882万

积分

论坛元老

Rank: 8Rank: 8

积分
48824836
热门排行