SQL Profiler for Openclaw

A sophisticated database performance assistant that identifies SQL bottlenecks and provides actionable optimization suggestions for multiple database dialects.

nerikko
v1.0.0
Mar 12, 2026
0
914
0

Install & Download

1. ClawHub CLI

The fastest way to install a skill directly from the registry.

npx clawhub@latest install sql-profiler

2. Manual Installation

Copy the skill folder to one of these locations

Global
~/.openclaw/skills/
Workspace
<project>/skills/

Priority: Workspace > Local > Bundled

3. Prompt Installation

Copy this prompt to OpenClaw to install it automatically.

Help me install sql-profiler using Clawhub. If Clawhub is not installed, install it first (npm i -g clawhub).

Prefer to download?

Get the raw skill files in a ZIP archive.

What is SQL Profiler?

SQL Profiler is a specialized tool designed for data engineers and developers who need to demystify query execution plans and eliminate performance lag. By integrating this into your workflow through Openclaw Skills, you gain an expert-level analysis of SQL queries that spans from standard ANSI SQL to distributed systems like Databricks and Spark SQL. It transforms cryptic database engine outputs into plain-English insights, helping teams maintain high-performance data environments without needing a dedicated DBA for every query tweak.

This skill excels at bridging the gap between raw execution data and actionable code changes. Whether you are dealing with a simple PostgreSQL instance or a complex multi-node Spark cluster, utilizing Openclaw Skills like this profiler ensures that your data layer remains efficient, scalable, and cost-effective.

SQL Profiler Use Cases

  • Identifying missing indexes in PostgreSQL databases to resolve slow-running queries.
  • Deciphering complex physical plans in Databricks to minimize expensive shuffle operations.
  • Refactoring legacy SQL code to eliminate N+1 query problems and accidental cross joins.
  • Estimating the performance impact of partitioning or Z-Ordering strategies on large datasets.
  • Providing junior developers with clear before-and-after examples of optimized query patterns.

How SQL Profiler Works

  1. The user provides a SQL query or the raw output of an EXPLAIN/EXPLAIN ANALYZE command.
  2. The skill identifies the specific SQL dialect (PostgreSQL, Databricks, Spark, or ANSI) to apply relevant optimization rules.
  3. It scans the query for anti-patterns such as full table scans, improper function usage in WHERE clauses, and inefficient join orders.
  4. The system parses the query plan to highlight the most expensive operations in terms of CPU or I/O cost.
  5. It generates a comprehensive report including the identified issues, a logical explanation of the impact, and optimized code snippets.

SQL Profiler Setup

To start using the SQL Profiler, you can invoke the commands directly within your supported AI agent interface. Ensure your environment has access to the Openclaw Skills repository.

# Analyze a specific query
/sql-profiler analyze --query "SELECT * FROM orders WHERE status = 'active'" --dialect postgresql

# Interpret a raw EXPLAIN plan
/sql-profiler explain-plan --output "[INSERT RAW EXPLAIN TEXT]" --dialect sparksql

SQL Profiler Data Schema & Taxonomy

The skill processes inputs and generates structured performance reports as detailed below:

Input Parameter Description Required
--query The raw SQL string to be analyzed. Yes (for analyze/optimize)
--dialect Options: postgresql, databricks, sparksql, ansi. No (defaults to ansi)
--explain-output The text output from the database's EXPLAIN command. No (highly recommended)

Output Schema:

  • Identified Issues: Categorized list of performance bottlenecks.
  • Optimization Rationale: Technical explanation of why the current pattern is suboptimal.
  • Code Comparison: A Markdown code block showing the original vs. the optimized query rewrite.
  • Performance Impact: Qualitative estimation of expected speed improvements.

SQL Profiler Advanced Features

  • Multi-dialect intelligence tailored for distributed computing environments like Spark and Delta Lake.
  • Specialized analysis for high-cardinality data handling using Z-Ordering and Partitioning suggestions.
  • Detection of database-specific anti-patterns, such as inefficient CTE materialization in PostgreSQL or data skew in Databricks.
  • Automatic conversion of correlated subqueries into more performant JOIN operations where applicable.
  • In-depth interpretation of physical plans including FileScan, HashAggregate, and Sort methods.

SKILL.md


Loading

Related Openclaw Skills

METADATA

Github Stars: 0
forks: 0

Featured*