postgresql-query-opt

Analyze PostgreSQL EXPLAIN ANALYZE plans and recommend indexing strategies.

2|1|Updated Jan 20, 2026
One-click install
npx skills add https://github.com/sraloff/gravityboots --skill postgresql-query-opt
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: postgresql-query-opt
Source: https://github.com/sraloff/gravityboots/tree/main/.agent/skills/postgresql-query-opt
Command: npx skills add https://github.com/sraloff/gravityboots --skill postgresql-query-opt

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

PostgreSQL performance bottlenecks are common; this skill helps you analyze queries, interpret explain plans, and design effective indexes to speed up workloads.

Core Features & Use Cases

  • Query plan analysis and EXPLAIN interpretation to identify bottlenecks.
  • Index strategy guidance (B-Tree, GIN, partial, covering) for common patterns.
  • Practical patterns for writing fast queries and avoiding anti-patterns in large schemas.
  • Use Case: When a slow query against a large orders table is observed, apply this skill to implement appropriate indexing and query rewrites to reduce response time.

Quick Start

Provide a slow query sample or plan, and this skill will output optimized indexing and rewriting recommendations.

Frequently Asked Questions about postgresql-query-opt

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

FAQPage Schema
How do I interpret PostgreSQL EXPLAIN ANALYZE outputs to find query bottlenecks?

Interpreting PostgreSQL EXPLAIN ANALYZE outputs involves analyzing query plans to identify performance bottlenecks like sequential scans or high cost estimates. This skill evaluates execution plans across diverse schemas to pinpoint inefficiencies and validate indexing strategies for slow queries.

What is the best way to design indexes for slow PostgreSQL queries?

The best way to design indexes for slow PostgreSQL queries is to evaluate query patterns and select appropriate strategies. This skill provides actionable index recommendations including B-Tree, GIN, partial, and covering indexes to speed up workloads on large tables.

How do I optimize SQL queries for large PostgreSQL schemas?

Optimizing SQL queries for large PostgreSQL schemas requires applying practical patterns to avoid anti-patterns and rewriting inefficient SQL. This skill evaluates query patterns against your schema to provide specific query rewrites that reduce response time.

When should I use partial or covering indexes in PostgreSQL?

You should use partial or covering indexes in PostgreSQL when specific query patterns filter on subsets of data or require additional columns without table lookups. This skill guides index strategy selection by evaluating your specific query patterns to recommend the most effective index type.

Can I use this to debug slow queries against a large orders table?

Yes, you can debug slow queries against a large orders table by providing a slow query sample or plan. The skill outputs optimized indexing and query rewriting recommendations designed to significantly reduce response time for large table workloads.