postgresql

Guide PostgreSQL schema design, SQL queries, indexing, transactions, and performance optimization.

4|1|Updated Dec 30, 2025
One-click install
npx skills add https://github.com/doanchienthangdev/omgkit --skill postgresql-doanchienthangdev
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: postgresql
Source: https://github.com/doanchienthangdev/omgkit/tree/main/plugin/skills/databases/postgresql
Command: npx skills add https://github.com/doanchienthangdev/omgkit --skill postgresql-doanchienthangdev

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill addresses the complexities of designing, querying, and optimizing PostgreSQL databases, ensuring efficient, scalable, and reliable data management.

Core Features & Use Cases

  • Schema Design: Create robust and normalized database schemas with appropriate constraints and data types.
  • Query Optimization: Write and tune SQL queries for maximum performance, utilizing indexing and execution plan analysis.
  • Transaction Management: Implement safe and efficient transactions, including advanced locking mechanisms.
  • Performance Tuning: Identify and resolve performance bottlenecks through analysis of statistics, indexes, and table bloat.
  • Use Case: Optimize a slow-running e-commerce product listing query by analyzing its execution plan, adding appropriate indexes, and rewriting it for better performance.

Quick Start

Use the postgresql skill to design a 'users' table with email, password_hash, and name columns, including unique constraints and a default role.

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 for an e-commerce backend?

To optimize slow PostgreSQL queries, you can analyze execution plans, implement appropriate indexing strategies, and rewrite SQL statements for better performance and resource utilization.

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

Designing a scalable PostgreSQL schema involves creating normalized structures with appropriate constraints, specific data types, and transaction control to ensure data integrity and maintainability.

How do PostgreSQL transactions and locking mechanisms work?

PostgreSQL transactions ensure safe database operations by utilizing advanced locking mechanisms to manage concurrent data access, maintaining data consistency and preventing conflicts during simultaneous modifications.

Can I resolve table bloat and performance bottlenecks through PostgreSQL performance tuning?

Yes, PostgreSQL performance tuning identifies and resolves bottlenecks by analyzing database statistics, evaluating index usage, and addressing table bloat to improve overall query throughput.

Why does my PostgreSQL product listing query have high resource utilization?

High resource utilization in PostgreSQL queries often stems from missing indexes, unoptimized SQL joins, or table bloat, which can be diagnosed by analyzing execution plans and database statistics.

Are unique constraints and default roles supported in PostgreSQL schema design?

Yes, PostgreSQL schema design supports implementing unique constraints on columns like email and assigning default roles to ensure data validation and secure user management from creation.