# Investigate a slow PostgreSQL query — acceptance checklist

Record evidence for every checked item. Unchecked or untested is not a pass. This checklist does not execute an integration or authorise external actions.

## Required inputs

- [ ] The SQL, relevant schema and a redacted query plan.

- [ ] Workload context and a representative non-production dataset.

## Output checks

- [ ] Database version, role, schema and representative parameters are recorded.

- [ ] Compared queries return equivalent results for the selected fixtures, including null and duplicate cases.

- [ ] Plans and timings use the same dataset and stated cache/concurrency conditions.

- [ ] Index write cost, lock exposure and rollback are considered before production changes.

## Deliverables

- [ ] SQL and plan snapshot

- [ ] Query/index proposal

- [ ] Result-equivalence evidence

- [ ] Migration and rollback note

## Evidence and decision

Evidence links: [fill in]
Untested paths: [fill in]
Unresolved findings: [fill in]
Reviewer: [fill in]
Decision and scope: [fill in]

## Boundaries

- Choose a host for each stage and verify its tool mapping. Pass evidence explicitly between stages; the listed resources do not automatically configure or invoke one another.

- Use a restricted database role and verify the server’s access mode. A catalogue pairing does not make unrestricted SQL safe.

- EXPLAIN ANALYZE executes the query. Index creation, schema changes and production execution require a separate authorised step.

Workflow: https://undominated.ai/workflows/#investigate-a-postgres-query
