انتقل إلى المحتوى
#0776
Sqlite

Find Tuesday's slow query without an insights tier

The app got slow on Tuesday. On a managed database, the answer lives in the provider's insights dashboard: a paid tier, someone else's retention window. Here the database keeps its own receipts. GET /api/v1/sqlite/history?db=app.db returns every query with its duration in milliseconds, rows affected, and status. GET /history/stats aggregates the lot: total queries, average duration, error count, first and last query timestamps.

You scan the history for anything over 200ms, find the unindexed scan the Friday deploy introduced, and fix it. No APM agent, no query-insights add-on, no log shipping. The query log is a property of the database, sitting at a URL, answering the only question that matters on Tuesday.

Slow queries confess in their own table.