postgresql

Optimize PostgreSQL queries with EXPLAIN ANALYZE and indexing strategies.

1|Updated Sep 26, 2025
One-click install
npx skills add https://github.com/pascallammers/mylo-travel-concierge-v2 --skill postgresql-pascallammers
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: postgresql
Source: https://github.com/pascallammers/mylo-travel-concierge-v2/tree/main/.factory/skills/postgresql
Command: npx skills add https://github.com/pascallammers/mylo-travel-concierge-v2 --skill postgresql-pascallammers

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill helps you write efficient, robust, and scalable PostgreSQL queries and database schemas, preventing performance bottlenecks and data integrity issues.

Core Features & Use Cases

  • Schema Design: Learn best practices for creating tables, defining data types, and implementing constraints.
  • Indexing Strategies: Understand how to use B-tree, GIN, GiST, and Hash indexes effectively.
  • Query Optimization: Master EXPLAIN ANALYZE to identify and fix slow queries.
  • Use Case: Optimize a slow-loading dashboard by analyzing its PostgreSQL queries with EXPLAIN ANALYZE and applying appropriate indexing and join strategies.

Quick Start

Use the postgresql skill to analyze the performance of the query 'SELECT * FROM users WHERE email = $1'.

Frequently Asked Questions about postgresql

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

FAQPage Schema
How do I optimize slow PostgreSQL queries?

PostgreSQL query optimization uses `EXPLAIN ANALYZE` to identify execution bottlenecks, allowing you to apply appropriate indexing and join strategies to improve slow query speed and overall database performance.

What is the best way to design a scalable PostgreSQL schema?

Designing a scalable PostgreSQL schema requires following best practices for creating tables, defining appropriate data types, and implementing constraints to ensure data integrity and prevent performance bottlenecks as the database grows.

When should I use GIN or GiST indexes in PostgreSQL?

You should use GIN or GiST indexes in PostgreSQL when dealing with specific data types or search requirements that B-tree indexes cannot handle efficiently, utilizing these indexing strategies for advanced performance tuning.

Why does my PostgreSQL database have data integrity issues?

PostgreSQL database data integrity issues often arise from poor schema design lacking proper constraints, which can be resolved by implementing robust table definitions and constraint strategies to maintain scalable and reliable data.

Can I use a Hash index instead of a B-tree for PostgreSQL performance tuning?

You can use a Hash index instead of a B-tree for PostgreSQL performance tuning when you need fast equality comparisons, whereas B-tree indexes are better suited for range queries and sorted output optimization.