Backstage catalog database performance
Use the pinned upstream procedure as detailed reference while protecting credentials and production databases.
When to invoke
- "Run the catalog query performance battery."
- "Compare catalog query plans to the baseline."
- "Check whether this catalog index change regressed performance."
- "Update the catalog database performance baseline."
Procedure
- Confirm Backstage core or close-fork mode and locate the catalog query battery and baseline.
- Read the pinned upstream procedure.
- Require a database replica or disposable test database. Do not run the battery against production.
- Obtain connection details through environment configuration without writing or echoing them.
- Establish catalog size and baseline comparability.
- Run every documented scenario with its timeout, plan, timing, buffer, and anti-pattern capture.
- Compare proportional timing and plan-shape changes to the previous baseline.
- Update the baseline in its existing format only when the complete battery finished.
- Report improvements, regressions, environment differences, and inconclusive scenarios.
Output template
## Catalog database performance result
**Database:** replica | disposable
**Baseline:** <path and date>
| Scenario | Plan change | Timing change | Buffers | Result |
| --- | --- | --- | --- | --- |
### Regressions
- <scenario, evidence, and recommendation>
Quality gate
- The database is a replica or disposable test environment.
- Credentials were neither stored nor printed.
- Every scenario used the documented timeout and captured a plan.
- Catalog size differences are included in interpretation.
- The baseline changed only after a complete run.
- Regressions distinguish timing noise from plan-shape and index changes.