ITPub博客

首页 > 数据库 > Oracle > sql tunning1 物化内连接视图:

sql tunning1 物化内连接视图:

Oracle 作者:li__hl8888 时间:2016-05-20 17:05:46 0 删除 编辑

物化内连接视图:     

with t1 as   

  1. (select /*+ materialize */  
  2.  a.user_name, a.invest_id  
  3.          from base_data_login_info@agent a  
  4.          where a.str_day <= '20160304' and a.str_day >= '20160301'  
  5.  and a.channel_id in (select channel_rlat from tb_user_channel a, tb_channel_info b where a.channel_id = b.channel_id and a.user_id = 5002)  
  6.  and a.platform = a.platform)  
  7. select count(distinct user_name) ,count(distinct invest_id) from t1;  

总结 :1>对于连接condition column,in条件column ,数据分布高度不平衡的列,

count(distinct colmn1)需要放在最外层。

          2> with t1 as     /*+ materialize */ 对数据不平衡比较有效。

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/8568259/viewspace-2103910/ ,如需转载,请注明出处,否则将追究法律责任。

上一篇: 创建data guard
下一篇: 优化学习笔记
请登录后发表评论 登录
全部评论

注册时间:2011-06-01

  • 博文量
    208
  • 访问量
    92690