数据库生态圈(RDB & NoSQL & Bigdata)——专注于关系库优化(Oracle & Mysql & Postgresql & SQL Server )

https://www.cnblogs.com/lhdz_bj
http://blog.itpub.net/8484829
https://blog.csdn.net/tuning_optmization
https://www.zhihu.com/people/lhdz_bj

导航

巨幅SQL优化(SQL Tuning)——秒杀十几个小时不出结果的SQL

今天接到用户的需求,某程序十几个小时没出结果了,很纳闷儿,于是让相关人员取了explain plan等信息,拿到explain plan后,搂一眼,就知道问题出在了哪里,explain plan跑偏了,看了下统计信息,不算陈旧,但还是重新收集了,但explain plan依然跑偏,因为用户急于跑这个程序,时间有些紧迫,于是只能通过加hint搞定,很简单的两个hint,当然,还有很多其他的方法,用户着急,我也不愿意费事,用户说可以加hint,于是,1秒钟出结果,下面是当时的explain plan,大家可以参考学习:





 

posted on 2018-03-09 15:34  lhdz_bj  阅读(511)  评论(0编辑  收藏  举报