sql

Optimize slow SQL queries with indexing and schema guidance.

Updated Feb 6, 2026
One-click install
npx skills add https://github.com/pointware/custom-marketplace --skill sql-pointware
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: sql
Source: https://github.com/pointware/custom-marketplace/tree/main/claude-plugins/data-toolkit/skills/sql
Command: npx skills add https://github.com/pointware/custom-marketplace --skill sql-pointware

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill helps data teams improve SQL performance and maintainability by guiding query optimization, indexing strategies, and data modeling decisions.

Core Features & Use Cases

  • Query Optimization Guidance: Diagnose slow queries, suggest plan improvements, and promote readable, maintainable SQL.
  • Indexing & Modeling Advice: Recommend indexing strategies and data modeling approaches (normalization vs denormalization) for analytics workloads.
  • Use Case Scenarios: Optimize dashboards, ETL pipelines, and reporting queries on large datasets.

Quick Start

Use the sql skill to optimize a provided slow analytics query by applying proper indexing, query rewriting, and data-modeling improvements on a representative dataset.

Frequently Asked Questions about sql

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

FAQPage Schema
How do I optimize slow SQL queries for analytics?

Query optimization involves analyzing execution plans, rewriting inefficient logic, and adding strategic indexes. Start by examining your query's plan to identify bottlenecks, then apply techniques like join reordering, filtering earlier in the query, and materializing intermediate results to improve speed on large datasets.

What indexing strategies work best for analytics workloads?

Analytics indexing differs from transactional indexing. Create composite indexes on frequently filtered columns, use covering indexes to avoid table lookups, and consider columnstore indexes for aggregation-heavy queries. Match index design to your query patterns rather than indexing everything.

When should I denormalize data for analytics instead of normalizing?

Denormalization trades update complexity for query speed in analytics. Denormalize when read volume far exceeds writes, queries span many joins, or aggregations repeat across dashboards. Keep normalized dimensions separate and denormalize fact tables strategically to balance maintainability with performance.

How do I diagnose why my analytics dashboard queries are slow?

Slow dashboards usually stem from missing indexes, inefficient joins, or scanning unnecessary data. Enable query execution plans, check index usage statistics, and profile wall-clock time per query section. Prioritize fixing full table scans and unindexed joins first.

Can I apply query optimization techniques to ETL pipelines?

Yes. ETL pipelines benefit from the same optimization principles: indexed staging tables, batch processing with efficient joins, and denormalized intermediate results. Structure transformations to minimize data movement and leverage database-side aggregation before extracting.

What schema design decisions impact query performance most?

Schema design determines performance ceiling. Partition large tables by date or region, choose appropriate data types to reduce storage and I/O, and design grain carefully—fact tables should atomize at your finest measurement level. Poor grain forces expensive aggregations downstream.