摘要: 有两个表,表a 表b 操作SQL如下: 我们先看下执行计划: 我们可以看到扫描行数是229049行,执行时间: 太可怕了,运行set profiling=1,让我们看看时间主要消耗在哪里? show profiles; 取id,用于下面的查询中 query后的参数 show profile cpu, 阅读全文
posted @ 2019-04-11 18:36 超轶绝尘 阅读(2006) 评论(0) 推荐(0)
摘要: 5.1版本开始引入show profile剖析单条语句功能,支持show profiles和show profile语句,参数have_profiling;控制是否开启: 查看是否支持这个功能(查询为yes表示支持): mysql > show variables like 'have_profil 阅读全文
posted @ 2019-04-11 18:32 超轶绝尘 阅读(556) 评论(0) 推荐(0)
摘要: 4张表级联查询的结果分组求和: While it's about 21W records of the result,time of select is about 31 ms. 更改如下: 查询时间:40ms左右 再将查询的结果map reduce 大概80+ms 阅读全文
posted @ 2019-04-11 16:42 超轶绝尘 阅读(331) 评论(0) 推荐(0)