zoukankan      html  css  js  c++  java
  • MacOS下安装小米SQL优化工具soar

    1 下载源码包 赋予权限

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

    2 安装Go语言

    brew install -y go

    发现版本不对,直接去https://golang.org/dl/下载Mac下的pkg安装包

    添加安装路径到path下

    vim ~/.bash_profile
    export PATH="/usr/local/go/bin:$PATH"
    退出编辑模式
    source ~/.bash_profile

    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优化利器,简单方便实用。

  • 相关阅读:
    进军装饰器2/3
    进军装饰器1/3
    购物车
    多级菜单(高效版)
    工资管理系统
    多级菜单(低效版)
    用户登录程序
    Accessibility辅助功能--一念天堂,一念地狱
    使用FragmentTabHost+TabLayout+ViewPager实现双层嵌套Tab
    android性能优化练习:过度绘制
  • 原文地址:https://www.cnblogs.com/QuestionsZhang/p/10326105.html
Copyright © 2011-2022 走看看