Boost Your Database Reliability with Xiaomi’s Open‑Source SQL Optimizer SOAR
Xiaomi is open‑sourcing its Go‑based SQL Optimizer and Rewriter (SOAR) at OSCAR Days, a tool that automatically checks SQL quality, suggests index improvements, rewrites queries, provides EXPLAIN analysis, and integrates with editor plugins and a web self‑audit platform to boost database reliability and developer productivity.
On October 20, at the OSCAR (Open Source Champion) Days event, Xiaomi announced the open‑source release of SOAR (SQL Optimizer And Rewriter), an intelligent SQL optimization and rewriting tool.
SOAR enables developers to quickly perform SQL quality checks, generate evaluation reports, and prevent problematic SQL from reaching production, thereby improving online code quality and reducing human‑error risks.
Facing rapid growth of Xiaomi’s internet services and database scale, the company’s DBA team built SOAR in Go to boost database stability, efficiency, and DBA productivity, and decided to open‑source it for the broader community.
SOAR consists of five modules: a syntax parser, an integrated development environment, optimization suggestions, rewrite logic, and a set of auxiliary tools. Its parser works independently of any specific database, allowing comprehensive review of SQL statements and the surrounding environment to uncover potential issues.
Key capabilities include detection of over 100 common SQL quality problems, index‑optimization recommendations for complex queries, automatic rewriting for dozens of SQL types, a pluggable heuristic strategy that can be customized per scenario, and EXPLAIN output interpretation to help DBAs and developers diagnose queries quickly.
To enhance usability, Xiaomi provides editor plugins that offer real‑time modification suggestions while writing SQL, as well as a web‑based self‑audit tool built on SOAR’s rich configuration options.
Additional auxiliary tools such as a Markdown‑to‑HTML converter and SQL formatter are also bundled with SOAR.
Embracing open source is a core part of Xiaomi’s engineering culture across mobile OS, cloud computing, big data, and AI; by open‑sourcing SOAR, Xiaomi hopes to collaborate with the community to improve SQL optimization algorithms and support the open‑source database ecosystem.
Efficient Ops
This public account is maintained by Xiaotianguo and friends, regularly publishing widely-read original technical articles. We focus on operations transformation and accompany you throughout your operations career, growing together happily.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.