- git: clone code from git repository
- go: build source
- govendor: manager third party dependency
- docker: manager test environment
- mysql: connect test environment
- retool: manager test tools such as
gometalinter.v2
,revive
,golangci-lint
- Unexpected quote, like `, ", '
- vitess syntax not supported yet
- SOAR will use online-dsn, test-dsn for data sampling and testing if they are on a different host to access these instance will cost much time. This may cause analyze slowly, especially when you are optimizing lots of queries.
- As mentioned above, if you set
-sampling=true
(by default), data sampling will take some time for more accurate suggestions.
# create test database
wget http://downloads.mysql.com/doc/sakila-db.tar.gz
tar zxf sakila-db.tar.gz && cd sakila-db
mysql -u root -p -f < sakila-schema.sql
mysql -u root -p -f < sakila-data.sql
# create test user
CREATE USER root@'hostname' IDENTIFIED BY "1t'sB1g3rt";
GRANT ALL ON *.* TO root@'hostname';
govendor fetch
or git clone
vitess in somewhere maybe very slow or be blocked, so we add vitess source code in vendor directory.
If you what to update vitess package, you should bypass that block using yourself method.
$ make vitess
#!/bin/bash
soar -query "select * from film" > ./index.html
(
echo To: youmail@example.com
echo From: robot@example.com
echo "Content-Type: text/html; "
echo Subject: SQL Analyze Report
echo
cat ./index.html
) | sendmail -t
advisor/rules.go HeuristicRules add a new item
advisor/heuristic.go add a new rule function
advisor/heuristic_test.go add a new test function
make doc
go test github.com/XiaoMi/soar/advisor -v -update -run TestListHeuristicRules
go test github.com/XiaoMi/soar/advisor -v -update -run TestMergeConflictHeuristicRules
make daily