背景
上个月,做了一个业务背景比较复杂,涉及表众多的etl处理,在整个过程中遇到了很多坑,其中最大的一个坑是,在整个s q l的处理过程中,有一段sql的执行花费时间较长,执行了二十多个小时未结束。严重影响了etl的进度,对此进行了一些列的优化,但效果甚微。
解决
具体的sql如下:(涉及业务隐私,表名和列名就简化了)
select * from
(select * from a1 where filedate='${filedate}') t1 left join
(select * from a2 where filedate='${filedate}') t2 left join
(select * from a3 where filedate='${filedate}') t3 left join
(