sql-review

Installation
SKILL.md

SQL Review - Index Analysis & Recommendations

Scan codebase for DDL and SQL queries, create tables on a PolarDB-X test instance, populate mock data, analyze index usage via EXPLAIN, and output optimization recommendations.

Prerequisites

  • curl must be available (for PolarDB-X Zero API calls to create/destroy instances)
  • mysql CLI client must be available (to connect and execute SQL)
  • If mysql is not available, prompt the user to install it (brew install mysql-client / apt install mysql-client / scoop install mysql)
  • If user chooses Aliyun instance mode, aliyun CLI must be available and configured with valid credentials (aliyun configure list)
  • All temporary files use the sql_review_ prefix. $TMPDIR in this document refers to a writable temp directory — determine the appropriate path for the current OS (e.g. /tmp on Linux/macOS, %TEMP% on Windows)

Progress File

Critical for long sessions: Initialize $TMPDIR/sql_review_progress.md at the start of Step 2 and append incrementally throughout the entire workflow.

  • After scanning each mapper/table (Step 2): append that table's SQL inventory immediately.
  • After EXPLAIN analysis per table (Step 5): append that table's EXPLAIN results and recommended DDL immediately.
  • In Step 6 (Report): read the progress file as the single source of truth to assemble the final report.
Related skills
Installs
7
GitHub Stars
4
First Seen
Apr 9, 2026