# XiaoMi/soar

SQL Optimizer And Rewriter

Repository: https://github.com/XiaoMi/soar
Canonical: https://ross.abutalabs.com/products/soar
Language: Go
License: Apache-2.0
License Family: permissive
Topics: sql, advisor, optimizer, rewrite, suggestion, mysql, syntax, auditor, indexing, database, command-line
Last push: 2023-12-15T09:13:07+00:00

## Health v2 (maintenance only)
Score: 23/100 (v2, computed 2026-09-02T17:46:02.011165+00:00)
- activity 0, release rhythm 8, longevity 100
- inputs: {"age_days": 2886, "days_push": 992, "days_rel": null, "gap_med": null, "n_releases_24m": 0}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 8758, forks 1319 (observed 2026-08-28T04:10:25.575664+00:00)

## What it is
SOAR (SQL Optimizer And Rewriter) is a command-line tool from Xiaomi's database team that automatically optimizes and rewrites SQL statements for MySQL. It provides heuristic query optimization, multi-column index suggestions, EXPLAIN interpretation, and SQL fingerprinting/beautification.

## Use cases
- analyze and optimize slow MySQL queries
- get index recommendations for SELECT, UPDATE, INSERT, DELETE statements
- rewrite SQL with custom rules
- audit SQL syntax and suggest improvements
- merge multiple ALTER TABLE requests into one
- pretty-print and fingerprint SQL statements
- interpret EXPLAIN output in a readable way

## When to choose
- you work with MySQL-family databases and want automated query review
- you need index advice for complex multi-column queries
- you want a standalone cross-platform CLI for SQL auditing in CI or DBA workflows

## When to avoid
- you use non-MySQL databases like PostgreSQL or SQL Server
- you need a GUI-based or always-on monitoring optimizer
- you require actively developed features, as the project is in maintenance with infrequent releases

## Facets
- artifact type: cli-tool
- maturity: maintenance
- function: database, developer-tools, cli
- domain: databases, developer-tools, performance
- platform: windows, cli, go
- tags: sql-optimizer, sql-rewriter, mysql, query-advisor, index-optimization, sql-audit, linux, macos

## Member repositories
- XiaoMi/soar (main) score 23

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:10:25.575664+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-29T17:25:15.522642+00:00, confidence not recorded.
  - readme: https://github.com/XiaoMi/soar (fetched 2026-08-28T04:10:25.575664+00:00, sha 712abf951624)
- Data as of 2026-08-30T08:39:29.467469+00:00.
