OneLinersCommand workbench
AI
Back to prompts
plain-prompt

Review a PostgreSQL slow-query plan

Explain plan nodes, cardinality errors, I/O, sorts, and safe measurement priorities.

Revision
1
Verified
2026-07-26
Save or explore
Save to collectionCreate a collection in the sidebar first.

Compatibility and paths

GenericWorks with instruction-following chat models.
ChatGPT
Claude Code
Gemini CLI

Trust and provenance

Curated record reviewed 2026-07-26. Results still depend on the supplied context and target environment.

Fill variables

Values stay in this browser tab and are not stored.

Generated asset2 required field(s) must be completed
Objective: Find the dominant plan cost without inventing an index.

Context: Schema changes require workload and write-cost evidence.

Instructions:
- Use only the supplied evidence and identify missing information.
- Lead with the finding, confidence, and one safe next action.
- Put read-only checks before mutations and include a stop condition.
- Never request or reproduce secrets, credentials, or private keys.

User request:
Version/schema context:
{{environment}}

EXPLAIN (ANALYZE, BUFFERS) output:
{{evidence}}

Review the plan.

Required output:
- Finding
- Evidence
- Confidence
- Safe next check
- Stop condition

Real example

Input

Seq Scan on events; rows=42 estimated, rows=820000 actual; shared read=63124

Expected result

The major issue is a cardinality underestimate followed by a large sequential read. Refresh statistics and inspect predicate selectivity before evaluating an index.

Source evidence

PostgreSQL documentationofficial