摘要:
一、SQL优化及分布键优化的总体原则:以执行计划为准,在执行计划中尽量不要有重分布的运算; 二、优化方法:1、SQL语句优化:1.1在where条件和关联条件中,如果等式两边分辨是字段和常数,尽量将运算符(例如:to_date, to_char)放在常数,而不是字段上;1.2如果 ta left j 阅读全文
摘要:
with all_user_id(select user_idfrom t1unionselect user_idfrom t2) 获取渠道all_channel(select case when t6.user_cate in ('1','2') then xx when t3.agent_cat 阅读全文
摘要:
一、优化点:1、not in 替换为 not exist;2、in 替换为 right join;3、distinct 替换为 group by;4、count(distinct) 替换为 count;5、where条件中,等号左右两边的数据类型需要一致;6、where条件中,等号左边不要有函数;7 阅读全文
摘要:
size(collect_set(case when COLUMN = column_value then column_1) over (partition by column_2, column_3 order by column_4 desc)) as column_4 1、含义:先以colu 阅读全文