Available in
Marketplaces, most starred first
Tags
Add to README
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
Marketplaces, most starred first
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
Marketplaces, most starred first
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
By koriymv0.5.0MITIn 1 marketplace
Finds MySQL query performance problems in SQL files and tests fixes against a live database before you commit them. Requires MySQL 8.0.18+ and a database connection.
Trending plugins
7-day copy clicks
Claude loads one when your task matches it, or you run it by name.
Executables (bin/) — files in this plugin's bin/ directory are added to the Bash tool's PATH while the plugin is enabled.
1 marketplace, most starred first
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
MySQL query analysis for coding agents and CI. It measures, the agent decides.
A coding agent can propose a rewrite or an index, but it cannot tell by reading the SQL whether the
rewrite returns the same rows, whether MySQL will use the index, or whether a problem is only hidden
by the optimizer today. sql-quality answers those questions against a real database and prints JSON:
EXPLAIN FORMAT=JSON, EXPLAIN ANALYZE, SHOW WARNINGS, the schema and the
optimizer trace go through 18 detectors. Every issue has a stable id, severity, evidence and, where
one applies, a suggested index or rewrite.Each statement is also explained with the optimizer features turned off: optimizer_impact.hidden_issues
lists the problems the optimizer currently works around, which can come back when statistics or data
volume change.
EXPLAIN ANALYZE; try-index uses invisible indexes)composer require --dev koriym/sql-quality
The connection is read from SQL_QUALITY_DSN, SQL_QUALITY_USER and SQL_QUALITY_PASSWORD, or from
--dsn, --user and --password (default mysql:host=127.0.0.1;dbname=test, root, empty password).
Prefer the environment variables: a password on the command line ends up in shell history and agent transcripts.
stdout carries the JSON report and nothing else; errors go to stderr.
vendor/bin/sql-quality analyze --sql-dir=sql/ --params=sql/params.json --fail-on=critical
Analyzes every *.sql file in the directory. --params maps a file name to its parameters
(a .json file, or a PHP file returning the same array); a file without an entry runs without
parameters, and one whose :name placeholders are not covered is listed in skipped as
UnboundParameter: name, ....
{
"1_full_table_scan.sql": {"min_views": 1000},
"15_listed_parameters.sql": {"names": ["Alice", "Bob"]}
}
--baseline=FILE takes an earlier analyze report and adds baseline.new, resolved, persisting
and unverified (files the earlier report had and this run did not analyze). With a baseline,
--fail-on counts only the new issues.
vendor/bin/sql-quality analyze --sql-dir=sql/ --params=sql/params.json > baseline.json # on the main branch
vendor/bin/sql-quality analyze --sql-dir=sql/ --params=sql/params.json --baseline=baseline.json --fail-on=warning
vendor/bin/sql-quality explain --sql-file=sql/1_full_table_scan.sql --params='{"min_views":1000}'
vendor/bin/sql-quality explain --sql="SELECT * FROM posts WHERE user_id = :id" --params='{"id":1}'
echo "SELECT * FROM posts" | vendor/bin/sql-quality explain --sql-file=-
One statement, as a file, inline or from stdin. The output is a summary: the issues and the optimizer
impact. --detail=full adds the EXPLAIN JSON, EXPLAIN ANALYZE, SHOW WARNINGS, the schema and the
optimizer trace.
{
"file": "1_full_table_scan.sql",
"sql": "SELECT * FROM posts WHERE view_count > 1000",
"executed": true,
"skipped_reason": null,
"cost": 503.45,
"execution_time_ms": 4.87,
"issues": [
{
"id": "FullTableScan@posts",
"type": "FullTableScan",
"message": "Full table scan detected.",
"documentation": "https://koriym.github.io/Koriym.SqlQuality/issues/FullTableScan",
"severity": "Critical",
"confidence": 0.95,
"evidence": {"table_name": "posts", "rows_examined_per_scan": 4952, "filtered": "33.33", "attached_condition": "(`test`.`posts`.`view_count` > 1000)"},
"suggestion": {"kind": "index", "description": "Add a composite index covering view_count", "ddl": "CREATE INDEX idx_posts_view_count ON posts (view_count)"}
}
],
"optimizer_impact": {"cost_without_optimizer": 503.45, "cost_reduction_percent": 0, "hidden_issues": []}
}
7-day copy clicks
npx claudepluginhub koriym/koriym.sqlquality --plugin sql-qualityBuilt from public signals: copy clicks on this site, GitHub stars and activity, the README and the manifest. Not a security audit or an endorsement.
Plugins from other owners that cover similar ground