sql-pro

Analyze SQL execution plans and optimize queries across PostgreSQL, MySQL, SQL Server, and Oracle.

Updated Mar 18, 2026
One-click install
npx skills add https://github.com/bpteam/coder --skill sql-pro-bpteam
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: sql-pro
Source: https://github.com/bpteam/coder/tree/main/.opencode/skills/sql-pro
Command: npx skills add https://github.com/bpteam/coder --skill sql-pro-bpteam

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Enables fast, reliable SQL performance by diagnosing slow queries, recommending indexing strategies, and guiding schema design to reduce bottlenecks and plan inefficiencies.

Core Features & Use Cases

  • Analyze execution plans (EXPLAIN/EXPLAIN ANALYZE) to identify bottlenecks in complex joins, window functions, and CTEs
  • Propose dialect-aware optimizations, including covering indexes, index tuning, and query rewrites
  • Provide end-to-end guidance for schema design, normalization considerations, and migration between PostgreSQL, MySQL, SQL Server, and Oracle

Quick Start

Give me a slow SQL query and I will return an optimized version with indexes and plan recommendations.

Frequently Asked Questions about sql-pro

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I optimize slow SQL queries with complex joins and window functions?

Optimize slow SQL queries by analyzing execution plans with EXPLAIN ANALYZE to identify bottlenecks in complex joins and window functions. This enables targeted query rewrites and indexing strategies to reduce latency and improve database performance.

What is the best way to design covering indexes for PostgreSQL and MySQL workloads?

Design covering indexes through dialect-aware optimization for PostgreSQL and MySQL workloads. Analyze execution plans to recommend index tuning strategies that eliminate unnecessary table lookups and accelerate query retrieval speed.

Does this SQL optimization approach work with Oracle and SQL Server execution plans?

Yes, this SQL optimization approach works with Oracle and SQL Server execution plans. It provides dialect-aware optimizations tailored for PostgreSQL, MySQL, SQL Server, and Oracle, ensuring reproducible results across different database platforms.

How do I read an EXPLAIN ANALYZE execution plan to find query bottlenecks?

Read an EXPLAIN ANALYZE execution plan by examining reported costs and scan methods to find query bottlenecks. This analysis reveals inefficiencies in CTEs and complex joins, guiding indexing strategies and query rewrites.

When should I rewrite CTEs instead of using indexing for performance optimization?

Rewrite CTEs instead of using indexing when execution plan analysis shows materialization bottlenecks rather than missing data access paths. This addresses structural query inefficiencies that indexing alone cannot resolve.