SQL Optimizer turns business requirements or slow SQL queries into correct, readable, dialect-specific SQL with actionable performance recommendations.
The fastest way to install a skill directly from the registry.
npx clawhub@latest install sql-optimizer
Copy the skill folder to one of these locations
~/.openclaw/skills/ <project>/skills/ Priority: Workspace > Local > Bundled
Copy this prompt to OpenClaw to install it automatically.
Help me install sql-optimizer using Clawhub. If Clawhub is not installed, install it first (npm i -g clawhub).
Get the raw skill files in a ZIP archive.
SQL Optimizer is an Openclaw Skills capability for translating business questions into production-ready SQL and systematically improving existing queries. It clarifies the expected result, filters, grouping, sorting, pagination, deduplication needs, database dialect, schema, indexes, and data volume before generating a solution.
The skill goes beyond rewriting syntax: it evaluates index usage, join order, functions on indexed columns, implicit type conversions, wildcard searches, pagination strategy, and execution plans. It also explains the reason, expected benefit, applicability, and trade-offs of each recommendation, while adding rollback and preview safeguards for UPDATE, DELETE, and DDL operations.
No external package installation is required; SQL Optimizer is an agent-created Openclaw Skills capability. Provide the following context in the request for the most reliable result:
Example request:
cat <<'REQUEST'
Database: PostgreSQL 16
Goal: List the 20 most recent paid orders for a customer.
Tables: orders(id bigint, customer_id bigint, status text, created_at timestamp)
Indexes: orders_customer_id_status_created_at_idx(customer_id, status, created_at)
Please write the query, review index usage, and explain how to validate it.
REQUEST
For validation, run the generated query in a safe environment with the target database's native plan command:
# PostgreSQL
EXPLAIN (ANALYZE, BUFFERS) <query>;
# MySQL
EXPLAIN ANALYZE <query>;
Never apply generated UPDATE, DELETE, or DDL statements directly to production without previewing affected rows, checking the execution plan, using an appropriate transaction or backup, and reviewing locking and rollback behavior.
SQL Optimizer organizes its analysis around the following logical data model:
| Section | Contents |
|---|---|
| Requirement summary | Desired output, business rules, filters, grouping, sorting, pagination, and deduplication requirements |
| Assumptions | Missing schema details, inferred relationships, expected field names, and assumptions requiring confirmation |
| Database context | Dialect, version, storage or execution characteristics, read/write separation, and compatibility constraints |
| Tables and fields | Table names, column names, data types, relationships, and relevant cardinality information |
| Existing indexes | Index columns, order, selectivity considerations, and whether a composite leftmost prefix is usable |
| Recommended SQL | A complete, readable, dialect-specific statement with comments where useful |
| Optimization points | Each rewrite with its rationale, expected benefit, applicability, and side effects |
| Index recommendations | Candidate CREATE INDEX statements with column-order reasoning and maintenance implications |
| Verification plan | EXPLAIN or EXPLAIN ANALYZE expectations, including access type, key, rows, filesort, and temporary-table indicators |
| Safety guidance | SELECT previews, WHERE requirements, transaction, backup, LIMIT, lock, and rollback considerations |
The skill does not require or imply generated files, migrations, database connections, or persistent storage. Its primary output is a structured response containing SQL, assumptions, recommendations, and validation steps.
Loading
Turn a product or topic into a ready-to-use social commerce note with engaging titles, concise first-person copy, layered hashtags, cover text, and a comment prompt.

Industry Report Digest converts lengthy market research and analyst reports into a concise, source-aware decision brief.

Turn school details, shared memories, and event themes into original, group-friendly lyrics and a finished song.

Plan a minimum-spec Huawei Cloud DWS cluster with calculated compute, storage, cache, and scale-out guidance.

Turn a child’s age and your parenting question into practical, age-aware activities and routine guidance, with clear boundaries for when to consult a professional.

Turn campaign details into polished poster copy, multiple visual directions, and image-generation prompts ready for design or production.








































