create or replace view sfgl_clfy_hzs as
select b.YSJE, b. DWTSJE ,b.SSJE, b.SJ,b.TBJE,aa.* from SFGL_CLFY_HZ aa
left join
(select jyh, round(sum(YSJE),2) YSJE, round(sum(DWTSJE),2) DWTSJE, round(sum(decode(SSJE,null,0,SSJE)),2) SSJE, round(sum(decode(SJ,null,0,SJ)),2) SJ, round(sum(decode(TBJE,null,0,TBJE)),2) TBJE from SFGL_CLF_JE group by jyh) b
on aa.jyh=b.jyh
打开这个视图时,速度特别慢,数据量大约30万条
------解决方案--------------------
SFGL_CLF_JE表的记录数。如果记录数很多,可以考虑建物化视图。
------解决方案--------------------
最好将视图分区 这样可以加快访问速度呀!