Use an agent to find missing database indexes
A developer had Cursor inspect a slow NestJS page and suggest database indexes to fix a production-only slowdown.
- What they did
- A page worked fine in development but lagged in production, so the developer asked a Cursor agent to look for likely causes and possible fixes. The agent read through the code and traced the NestJS queries being issued, then pointed out which indexes should help.
- How it went
- After the developer added the suggested indexes, the page became much faster. The agent did not apply the changes itself, so they still had to make the update and verify the result in production.
- Tips
- Ask the agent to rank the likely bottlenecks and explain each recommendation. Keep it read-only until you review the proposed changes, especially before anything that would alter data or deploy to production.
Try it yourself with Cursor
My [NestJS] app is fast in [development/local] but slow on [production page or endpoint]. Inspect the code path and the database queries it triggers, identify the most likely performance bottlenecks, and recommend the specific indexes or query changes that would help. For each item, explain why it matters and give the exact migration or code edit needed. Stop after presenting a ranked list and wait for my approval before making any change that would affect data, deployment, or production behavior.
Fill in the [brackets]. Agents can make mistakes, so review anything before it is sent, paid or deleted.
Get 3 agent uses like this every morning
With the day's top AI news. Free, and one click to unsubscribe.
Related agent uses
Hand small repo fixes to Cursor agents
A developer used Cursor agents to chip away at a daily batch of repo maintenance, bug fixes, and minor features.
Use Cursor to run Terraform through MCP
A developer used Cursor with tfmcp to plan and apply Postgres Terraform changes, then fell back to the terminal when permissions blocked the first attempt.
Turn saved bookmarks into quick demo builds
A daily bookmark check can feed Cursor a new tech idea and produce a prototype after approval.
Triage upgrades and move major ones in stages
Kent C. Dodds used Cursor to organize site dependency work, then carried out a Remix v2 to React Router v7 migration and related updates.
Turn a short ticket into a landing page
Cursor’s background agent made a pricing page from a brief spec, opened a PR, and let the developer review it before shipping.
Run coding agents in long autonomous cycles
Use a planner-worker loop with periodic review to keep coding agents moving on a large repository task.