# Meituan-Dianping/SQLAdvisor

输入SQL，输出索引优化建议

Repository: https://github.com/Meituan-Dianping/SQLAdvisor
Canonical: https://ross.abutalabs.com/products/sqladvisor
Language: C
License: GPL-2.0
License Family: copyleft
Last push: 2023-10-08T02:42:08+00:00

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

## Adoption (not part of the score)
Stars 5616, forks 1235 (observed 2026-08-28T04:09:23.030289+00:00)

## What it is
SQLAdvisor is a command-line tool developed by Meituan-Dianping's DBA team that analyzes SQL statements and outputs index optimization suggestions. It uses MySQL's native lexical parsing to examine WHERE conditions, aggregation clauses, and multi-table JOIN relationships.

## Use cases
- get index recommendations for a slow SQL query
- analyze which indexes to add for a MySQL query
- optimize WHERE clause and JOIN conditions with proper indexes
- review SQL indexing advice before deploying a query
- help DBAs tune database indexes automatically

## When to choose
- you maintain MySQL databases and need automated index advice
- you want a lightweight CLI tool to analyze SQL statements offline
- you're a DBA auditing queries for missing or suboptimal indexes

## When to avoid
- you use databases other than MySQL
- you need a fully maintained tool with active development and recent features
- you want an automated always-on query optimizer rather than an on-demand analyzer

## Facets
- artifact type: cli-tool
- maturity: maintenance
- function: database, developer-tools, parser
- domain: databases, developer-tools, performance
- platform: cli, cpp
- tags: mysql, index-optimization, sql-analysis, dba-tools, query-optimization, linux

## Member repositories
- Meituan-Dianping/SQLAdvisor (main) score 32

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:09:23.030289+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:55:24.590443+00:00, confidence not recorded.
  - readme: https://github.com/Meituan-Dianping/SQLAdvisor (fetched 2026-08-28T04:09:23.030289+00:00, sha 8aac1e81b2cd)
- Data as of 2026-08-30T08:39:29.467469+00:00.
