Postgresql Query Opt
Helps with PostgreSQL, querying as part of working with databases and data persistence workflows.
Install on your platform
We auto-selected Claude Code based on this skill’s supported platforms.
Run in terminal (recommended)
claude mcp add postgresql-query-opt npx -- -y @trustedskills/postgresql-query-opt
Or manually add to ~/.claude/settings.json
{
"mcpServers": {
"postgresql-query-opt": {
"command": "npx",
"args": [
"-y",
"@trustedskills/postgresql-query-opt"
]
}
}
}Requires Claude Code (claude CLI). Run claude --version to verify your install.
About This Skill
What it does
This skill optimizes PostgreSQL queries to improve performance and reduce resource consumption. It analyzes SQL statements, identifies potential bottlenecks, and suggests or automatically applies optimizations like index creation or query rewriting. The goal is to significantly speed up database operations and enhance overall application efficiency.
When to use it
- Slow Report Generation: When generating complex reports from a PostgreSQL database takes an unacceptably long time.
- High Database Load: To reduce CPU usage and latency when the database server is experiencing high load.
- Query Performance Tuning: As part of a proactive strategy to regularly review and improve query performance in production environments.
- Application Migration: When migrating an application to PostgreSQL, ensuring queries are optimized for the new environment.
Key capabilities
- SQL statement analysis
- Index suggestion
- Query rewriting
- Performance bottleneck identification
Example prompts
- "Optimize this SQL query:
SELECT * FROM orders WHERE customer_id = 123;" - "Analyze the performance of this stored procedure and suggest improvements."
- "Can you identify any missing indexes that would improve query speed on the 'products' table?"
Tips & gotchas
This skill requires access to a PostgreSQL database. The agent needs appropriate permissions to analyze queries and potentially modify the schema (e.g., create indexes).
Tags
TrustedSkills Verification
Unlike other registries that point to live repositories, TrustedSkills pins every skill to a verified commit hash. This protects you from malicious updates — what you install today is exactly what was reviewed and verified.
Security Audits
| Gen Agent Trust Hub | Pass |
| Socket | Pass |
| Snyk | Pass |
🌐 Community
Passed automated security scans.