postgresql-database-engineering

Optimize PostgreSQL queries and schemas with indexing, partitioning, replication, and VACUUM maintenance.

61|15|Updated Oct 18, 2025
One-click install
npx skills add https://github.com/manutej/luxor-claude-marketplace --skill postgresql-database-engineering
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: postgresql-database-engineering
Source: https://github.com/manutej/luxor-claude-marketplace/tree/main/plugins/luxor-database-pro/skills/postgresql-database-engineering
Command: npx skills add https://github.com/manutej/luxor-claude-marketplace --skill postgresql-database-engineering

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill equips you with advanced PostgreSQL engineering techniques including indexing, partitioning, replication, and maintenance for production-grade databases.

Core Features & Use Cases

  • Indexing & Partitioning: Performance at scale
  • Replication & HA: Streaming & failover
  • Maintenance: VACUUM, autovacuum, backups
  • Monitoring: pg_stat, explain plans
  • Use Case: Scale an e-commerce platform with a highly concurrent dataset.

Quick Start

Create a baseline index and replicate to standby.

Frequently Asked Questions about postgresql-database-engineering

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

FAQPage Schema
How do I optimize slow PostgreSQL queries in production?

Optimize slow PostgreSQL queries by analyzing EXPLAIN plans to identify sequential scans, then create appropriate indexes (B-tree, GiST, GIN, BRIN) on frequently filtered or joined columns. Monitor query performance with pg_stat views and adjust index strategy based on workload patterns.

What indexing strategies work best for large-scale PostgreSQL databases?

Large-scale PostgreSQL databases benefit from multiple index types: B-tree for equality and range queries, GIN for full-text search, BRIN for time-series data, and GiST for spatial queries. Select index type based on column data type and query patterns to balance performance and maintenance overhead.

How do I set up PostgreSQL replication and failover for high availability?

Configure streaming replication by setting up a standby server with WAL archiving enabled, then promote it on primary failure. Logical replication offers selective table replication for complex topologies. Monitor replication lag with pg_stat_replication to ensure failover readiness.

What maintenance tasks keep PostgreSQL performing well in production?

Run VACUUM regularly to reclaim dead tuples and update visibility maps, configure autovacuum thresholds for your workload, perform ANALYZE to maintain query planner statistics, and implement backup and recovery procedures using WAL archiving and point-in-time recovery.

Can I partition large PostgreSQL tables to improve query performance?

PostgreSQL partitioning splits large tables by range, list, or hash to enable parallel query execution and faster maintenance. Partition strategically based on access patterns—time-based partitioning suits time-series data, while range partitioning works for logically distinct data subsets.

Do I need multiple index types for different PostgreSQL workload patterns?

Yes. OLTP workloads typically use B-tree indexes for transactional queries, while analytical workloads benefit from BRIN for columnar scans over large ranges. GIN indexes accelerate full-text search; choose index type based on query selectivity and data access patterns to optimize both reads and write costs.