mysql大表join小表速度很慢_mysql多表join中,为什么子查询会那么慢,怎么解决-问答-阿里云开发者社区-阿里云...
下面的sql執行后cpu100%,但是這三張join的表數據量都在2W左右,不應該啊,是不是數據庫服務器配置出了問題啊。sql如下:select a.excel_id, a.rpt_id, a.acc_std, a.prd_year, a.prd_qtr, a.accumulate, a.biz_cd, a.acc_cd, a.row_num,
a.col_num,a.col_unit , a.col_cur, a.row_unit, a.row_cur, a.data_id, a.item_cd, a.data_val,
a.data_comment, a.data_trans_comment, a.trans_flag, a.trace_flag, a.trace_edit,
b.data_src, b.orig_unit, b.pre_unit, c.data_trace
from (select * from cdp.listed_cpny_rpt_fin_style_6 where excel_id = 32) a
inner join (select * from cdp.listed_cpny_fin_rpt_prd where excel_id = 32) b
on (a.excel_id=b.excel_id and a.rpt_id=b.rpt_id and a.acc_std=b.acc_std and a.prd_year=b.prd_year
and a.prd_qtr=b.prd_qtr and a.accumulate=b.accumulate and a.biz_cd=b.biz_cd and a.acc_cd=b.acc_cd )
left outer join (select * from cdp.listed_cpny_rpt_fin_trace_6 where excel_id = 32) c on
(a.excel_id = c.excel_id and a.rpt_id = c.rpt_id and a.acc_std = c.acc_std and a.prd_year = c.prd_year
and a.prd_qtr = c.prd_qtr and a.accumulate=c.accumulate and a.biz_cd = c.biz_cd
and a.acc_cd = c.acc_cd and a.row_num = c.row_num)
總結
以上是生活随笔為你收集整理的mysql大表join小表速度很慢_mysql多表join中,为什么子查询会那么慢,怎么解决-问答-阿里云开发者社区-阿里云...的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 命令行用pip命令安装mysql_使用p
- 下一篇: mysql分别写出3条索引_MySQL3