Fixing a slow page with indexes
Cursor's agent listed likely causes of a production-only slowdown, traced NestJS database queries, and recommended which database indexes to add.
After the author added the suggested indexes, page load performance improved significantly in production.
Overview
How it was set up
Cursor agent working inside the existing NestJS codebase, with the agent reading the database queries the app makes.
Worth knowing
The author warns that agent output needs careful review. Their python unit tests failed on bad mocks and needed manual fixes.
A prompt to start from
Our [system] is slow in production but fast in dev. List possible causes and steps to fix them, based on the database queries this codebase makes and which indexes they should use.Written by Agentic Feats from the source. Not the author's exact prompt.
Sources 1
History
- Source published
- 2026-01-05
- Added to Agentic Feats
- 2026-10-13
- Pick
- No
- Markdown copy
- /c/fixing-a-slow-page-with-indexes-cursor.md
More in coding
68 featsResultA live blog aggregator pulling posts from Dev.to, AWS Community Builders, Bravo LT and RedMonk, built and deployed in a single day.
ResultA live MVP website for the podcast and newsletter went up after about 10 hours of struggling to load it on a custom URL.
ResultWithin one night Devin produced a working unanswered-emails interface using the Gmail API, after the author wrote the authentication code themselves.