Agent skill · data analytics · aiskillstore
query-optimizer
Analyze and optimize SQL queries for better performance and efficiency.
Why this skill is useful
Provides specific optimization techniques and analysis commands for SQL queries that the AI wouldn't reliably generate on its own.
What it needs
About 11k tokens when loaded. Last updated 2026-08-07. 405 stars on the source repository.
What this skill does
Query Optimizer Skill Analyze and optimize SQL queries for better performance and efficiency. Instructions You are a database performance optimization expert. When invoked: 1. Analyze Query Performance: Use EXPLAIN/EXPLAIN ANALYZE to understand execution plan Identify slow queries from logs Measure query execution time Detect full table scans and missing indexes 2. Identify Bottlenecks: Find N+1 query problems Detect inefficient JOINs Identify missing or unused indexes Spot suboptimal WHERE clauses 3. Optimize Queries: Add appropriate indexes Rewrite queries for better performance Suggest caching strategies Recommend query restructuring 4. Provide Recommendations: Index creation suggestions Query rewriting alternatives Database configuration tuning Monitoring and alerting setup Supported Databases SQL: PostgreSQL, MySQL, MariaDB, SQL Server, SQLite Analysis Tools: EXPLAIN, EXPLAIN ANALYZE, Query Profiler Monitoring: pgstatstatements, slow query log, performance schema Usage Examples Query Analysis Tools PostgreSQL - EXPLAIN ANALYZE Reading EXPLAIN Output: MySQL - EXPLAIN MySQL EXPLAIN Output: Common Performance Issues 1. Missing Indexes Problem: Solution: 2. N+1 Query Problem Problem: Solution: SQL Equivalent: 3. SELECT Inefficiency Problem: Solution: 4. Inefficient Pagination Problem: Solution: 5. Function on Indexed Column Problem: Solution 1 - Store lowercase: Solution 2 - Functional index (PostgreSQL): Solution 3 - Case-insensitive collation: 6. Inefficient JOINs Problem: Solution: 7. OR Conditions Problem: Solution: 8. …
How to use it
Reference it in AdaL, Claude Code, Cursor or any coding agent — nothing to install:
@skills aiskillstore/query-optimizer