Skip to content

Commit 7e8e07a

Browse files
committed
docs(readme): Remove soar help section from README
- Removed the detailed `soar help` command section to streamline the README - The removal helps to avoid clutter and keeps the focus on essential information - Users can refer to the official documentation for comprehensive usage instructions
1 parent 8fdce34 commit 7e8e07a

File tree

1 file changed

+8
-171
lines changed

1 file changed

+8
-171
lines changed

README.md

Lines changed: 8 additions & 171 deletions
Original file line numberDiff line numberDiff line change
@@ -71,25 +71,24 @@ $sqls = [
7171
/**
7272
* Examples of scoring.
7373
*/
74-
$scores = Soar::make()->arrayScores($sqls);
75-
$scores = Soar::make()
74+
$scores = Soar::make()->arrayScores($sqls); // Basic scoring
75+
76+
$scores = Soar::make() // Advanced scoring
7677
->withTestDsn([
7778
'user' => 'you_user',
7879
'password' => 'you_password',
7980
'addr' => 'you_host:you_port',
80-
// 'addr' => '127.0.0.1:3306',
8181
// 'host' => 'you_host',
8282
// 'port' => 'you_port',
8383
'schema' => 'you_dbname',
84-
'disable' => false,
84+
// 'disable' => false,
8585
])
8686
->withOnlineDsn([
8787
'user' => 'you_user',
8888
'password' => 'you_password',
89-
'addr' => 'you_host:you_port',
90-
// 'addr' => '127.0.0.1:3306',
91-
// 'host' => 'you_host',
92-
// 'port' => 'you_port',
89+
// 'addr' => 'you_host:you_port',
90+
'host' => 'you_host',
91+
'port' => 'you_port',
9392
'schema' => 'you_dbname',
9493
'disable' => true,
9594
])
@@ -115,7 +114,7 @@ $syntaxCheck = Soar::make()->withOnlySyntaxCheck(true)->withQuery('SELECT * FRO
115114
</details>
116115

117116
<details>
118-
<summary><b>SQL Scores(SQL fingerprint、Score、Explain interpretation、Heuristic rule suggestions、Index rule suggestions)</b></summary>
117+
<summary><b>SQL Scores(Fingerprint、Score、Explain、Heuristic suggestions、Index suggestions)</b></summary>
119118

120119
```php
121120
$sqls = <<<'sql'
@@ -505,168 +504,6 @@ array:9 [
505504
![](docs/scores.png)
506505
</details>
507506

508-
<details>
509-
<summary><b>soar help</b></summary>
510-
511-
```php
512-
$soar->help()
513-
```
514-
515-
```plain
516-
Usage of /Users/yaozm/Documents/develop/soar-php/bin/soar.darwin-amd64:
517-
-allow-charsets string
518-
AllowCharsets (default "utf8,utf8mb4")
519-
-allow-collates string
520-
AllowCollates
521-
-allow-drop-index
522-
AllowDropIndex, 允许输出删除重复索引的建议
523-
-allow-engines string
524-
AllowEngines (default "innodb")
525-
-allow-online-as-test
526-
AllowOnlineAsTest, 允许线上环境也可以当作测试环境
527-
-blacklist string
528-
指定 blacklist 配置文件的位置,文件中的 SQL 不会被评审。一行一条SQL,可以是指纹,也可以是正则
529-
-check-config
530-
Check configs
531-
-cleanup-test-database
532-
单次运行清理历史1小时前残余的测试库。
533-
-column-not-allow-type string
534-
ColumnNotAllowType (default "boolean")
535-
-config string
536-
Config file path
537-
-delimiter string
538-
Delimiter, SQL分隔符 (default ";")
539-
-drop-test-temporary
540-
DropTestTemporary, 是否清理测试环境产生的临时库表 (default true)
541-
-dry-run
542-
是否在预演环境执行 (default true)
543-
-explain
544-
Explain, 是否开启Explain执行计划分析 (default true)
545-
-explain-format string
546-
ExplainFormat [json, traditional] (default "traditional")
547-
-explain-max-filtered float
548-
ExplainMaxFiltered, filtered大于该配置给出警告 (default 100)
549-
-explain-max-keys int
550-
ExplainMaxKeyLength, 最大key_len (default 3)
551-
-explain-max-rows int
552-
ExplainMaxRows, 最大扫描行数警告 (default 10000)
553-
-explain-min-keys int
554-
ExplainMinPossibleKeys, 最小possible_keys警告
555-
-explain-sql-report-type string
556-
ExplainSQLReportType [pretty, sample, fingerprint] (default "pretty")
557-
-explain-type string
558-
ExplainType [extended, partitions, traditional] (default "extended")
559-
-explain-warn-access-type string
560-
ExplainWarnAccessType, 哪些access type不建议使用 (default "ALL")
561-
-explain-warn-extra string
562-
ExplainWarnExtra, 哪些extra信息会给警告 (default "Using temporary,Using filesort")
563-
-explain-warn-scalability string
564-
ExplainWarnScalability, 复杂度警告名单, 支持O(n),O(log n),O(1),O(?) (default "O(n)")
565-
-explain-warn-select-type string
566-
ExplainWarnSelectType, 哪些select_type不建议使用
567-
-ignore-rules string
568-
IgnoreRules, 忽略的优化建议规则 (default "COL.011")
569-
-index-prefix string
570-
IdxPrefix (default "idx_")
571-
-list-heuristic-rules
572-
ListHeuristicRules, 打印支持的评审规则列表
573-
-list-report-types
574-
ListReportTypes, 打印支持的报告输出类型
575-
-list-rewrite-rules
576-
ListRewriteRules, 打印支持的重写规则列表
577-
-list-test-sqls
578-
ListTestSqls, 打印测试case用于测试
579-
-log-level int
580-
LogLevel, 日志级别, [0:Emergency, 1:Alert, 2:Critical, 3:Error, 4:Warning, 5:Notice, 6:Informational, 7:Debug] (default 3)
581-
-log-output string
582-
LogOutput, 日志输出位置 (default "soar.log")
583-
-log_err_stacks
584-
log stack traces for errors
585-
-log_rotate_max_size uint
586-
size in bytes at which logs are rotated (glog.MaxSize) (default 1887436800)
587-
-markdown-extensions int
588-
MarkdownExtensions, markdown 转 html支持的扩展包, 参考blackfriday (default 94)
589-
-markdown-html-flags int
590-
MarkdownHTMLFlags, markdown 转 html 支持的 flag, 参考blackfriday
591-
-max-column-count int
592-
MaxColCount, 单表允许的最大列数 (default 40)
593-
-max-distinct-count int
594-
MaxDistinctCount, 单条 SQL 中 Distinct 的最大数量 (default 5)
595-
-max-group-by-cols-count int
596-
MaxGroupByColsCount, 单条 SQL 中 GroupBy 包含列的最大数量 (default 5)
597-
-max-in-count int
598-
MaxInCount, IN()最大数量 (default 10)
599-
-max-index-bytes int
600-
MaxIdxBytes, 索引总长度限制 (default 3072)
601-
-max-index-bytes-percolumn int
602-
MaxIdxBytesPerColumn, 索引中单列最大字节数 (default 767)
603-
-max-index-cols-count int
604-
MaxIdxColsCount, 复合索引中包含列的最大数量 (default 5)
605-
-max-index-count int
606-
MaxIdxCount, 单表最大索引个数 (default 10)
607-
-max-join-table-count int
608-
MaxJoinTableCount, 单条 SQL 中 JOIN 表的最大数量 (default 5)
609-
-max-pretty-sql-length int
610-
MaxPrettySQLLength, 超出该长度的SQL会转换成指纹输出 (default 1024)
611-
-max-query-cost int
612-
MaxQueryCost, last_query_cost 超过该值时将给予警告 (default 9999)
613-
-max-subquery-depth int
614-
MaxSubqueryDepth (default 5)
615-
-max-text-cols-count int
616-
MaxTextColsCount, 表中含有的 text/blob 列的最大数量 (default 2)
617-
-max-total-rows uint
618-
MaxTotalRows, 计算散粒度时,当数据行数大于MaxTotalRows即开启数据库保护模式,不计算散粒度 (default 9999999)
619-
-max-value-count int
620-
MaxValueCount, INSERT/REPLACE 单次批量写入允许的行数 (default 100)
621-
-max-varchar-length int
622-
MaxVarcharLength (default 1024)
623-
-min-cardinality float
624-
MinCardinality,索引列散粒度最低阈值,散粒度低于该值的列不添加索引,建议范围0.0 ~ 100.0
625-
-online-dsn string
626-
OnlineDSN, 线上环境数据库配置, username:********@tcp(ip:port)/schema (default "tcp/information_schema?timeout=3s&charset=utf8")
627-
-only-syntax-check
628-
OnlySyntaxCheck, 只做语法检查不输出优化建议
629-
-print-config
630-
Print configs
631-
-profiling
632-
Profiling, 开启数据采样的情况下在测试环境执行Profile
633-
-query string
634-
待评审的 SQL 或 SQL 文件,如 SQL 中包含特殊字符建议使用文件名。
635-
-report-css string
636-
ReportCSS, 当 ReportType 为 html 格式时使用的 css 风格,如不指定会提供一个默认风格。CSS可以是本地文件,也可以是一个URL
637-
-report-javascript string
638-
ReportJavascript, 当 ReportType 为 html 格式时使用的javascript脚本,如不指定默认会加载SQL pretty 使用的 javascript。像CSS一样可以是本地文件,也可以是一个URL
639-
-report-title string
640-
ReportTitle, 当 ReportType 为 html 格式时,HTML 的 title (default "SQL优化分析报告")
641-
-report-type string
642-
ReportType, 优化建议输出格式,目前支持: json, text, markdown, html等 (default "markdown")
643-
-rewrite-rules string
644-
RewriteRules, 生效的重写规则 (default "delimiter,orderbynull,groupbyconst,dmlorderby,having,star2columns,insertcolumns,distinctstar")
645-
-sampling
646-
Sampling, 数据采样开关
647-
-sampling-condition string
648-
SamplingCondition, 数据采样条件,如: WHERE xxx LIMIT xxx
649-
-sampling-statistic-target int
650-
SamplingStatisticTarget, 数据采样因子,对应 PostgreSQL 的 default_statistics_target (default 100)
651-
-show-last-query-cost
652-
ShowLastQueryCost
653-
-show-warnings
654-
ShowWarnings
655-
-spaghetti-query-length int
656-
SpaghettiQueryLength, SQL最大长度警告,超过该长度会给警告 (default 2048)
657-
-test-dsn string
658-
TestDSN, 测试环境数据库配置, username:********@tcp(ip:port)/schema (default "tcp/information_schema?timeout=3s&charset=utf8")
659-
-trace
660-
Trace, 开启数据采样的情况下在测试环境执行Trace
661-
-unique-key-prefix string
662-
UkPrefix (default "uk_")
663-
-verbose
664-
Verbose
665-
-version
666-
Print version info
667-
```
668-
</details>
669-
670507
<details>
671508
<summary><b>:warning: When running in a unix OS non-cli environment, may throw `Fatal error: ...Exit Code: 2(Misuse of shell builtins)...`</b></summary>
672509

0 commit comments

Comments
 (0)