码迷,mamicode.com
首页 > 移动开发 > 详细

Centos7下安装小米SQL优化工具SOAR

时间:2019-01-27 14:30:00      阅读:510      评论:0      收藏:0      [点我收藏+]

标签:测试安装   soa   测试   sel   分享   info   last   .com   centos7   

1 下载源码包 赋予权限

  wget https://github.com/XiaoMi/soar/releases/download/0.9.0/soar.linux-amd64 -O soar
  chmod a+x soar

 

 

2 安装Go语言

yum install -y go

技术分享图片

3 源码安装

go get -d github.com/XiaoMi/soar
cd ${GOPATH}/src/github.com/XiaoMi/soar && make

4 然后测试安装是否成功

cd ${GOPATH}/src/github.com/XiaoMi/soar/bin
echo ‘SELECT SUM(CASE a.status WHEN 101005 THEN a.duration / 60.0 * a.rate WHEN ‘101001‘ THEN a.duration / 60.0 * a.rate WHEN ‘101004‘ THEN 0 - a.duration / 60.0 * a.rate ELSE a.duration / 60.0 * a.rate END) AS money2, a.teacher_id, b.first_name, b.last_name , b.avatar, b.paypal_account FROM `t_coursesession` a LEFT JOIN t_teacher b ON a.teacher_id = b.teacher_id WHERE (((a.status = 101005 OR a.status = 101001 OR a.status = 101004)) AND b.is_delete = 0 AND a.is_delete = 0) GROUP BY a.teacher_id ORDER BY money2 DESC‘ | ./soar

结果显示:

技术分享图片

 

 SQL优化利器,简单方便实用。

 

Centos7下安装小米SQL优化工具SOAR

标签:测试安装   soa   测试   sel   分享   info   last   .com   centos7   

原文地址:https://www.cnblogs.com/QuestionsZhang/p/10325987.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!