Skip to content

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