Databases
Find the queries that slow your pages
Pages got slower as data grew, and adding a cache only hid it.
- What you get
- The slowest queries measured, with the missing index or repeated query behind each.
- Paste it into
- Your AI tool, in your project
The prompt
Some pages have become slow as my data grew. Find the database causes with measurements, not guesses. Trace the slowest pages to their queries. Look for: the same query run once per row in a loop, queries that fetch whole tables or every column when a few are needed, filters and sorts on columns with no index, and lists with no page limit. For each finding give the file and line, how you measured it (query plan or timing), the fix, and the expected gain. Apply the fixes one at a time and measure again after each. Add indexes through a migration, and tell me if any index could be slow to build on a large table.
Use it
Open your AI tool (Claude Code, Codex or Cursor) in your project folder and paste it in.
More in Databases
Fix “too many connections” errors
The database refuses connections under light traffic on a serverless host.
Rename or remove a column without losing data
A simple rename can break the live app or wipe a column for good.
Let the database reject bad data
Duplicates, empty fields and orphaned rows creep in because only the form checks them.
Delete a user and everything they own
Someone asks you to delete their account, and their data is scattered across tables and services.