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.

Done with Cursor· Intermediate· Dec 2025

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.