Back to Prompts
Coding Assistant

Find and Fix a Slow Query with an Index

Start here. The fastest path from "my page is slow" to "it's fast now" From the Database Indexing AI Coding Building Block.

Prompt
My [app / Django app / Rails app / Node app] has a page that loads slowly: [describe the page, e.g. "the orders list filtered by customer" or "the search results page"].

The table has [number] rows and growing. Find the slow query, explain why it's slow, and add a database index to fix it.

After adding the index:
- Show me the before and after query speed difference
- Explain what the index does in plain English
- Tell me if I need to run a migration or any extra step

My stack: [your language and framework here, e.g. Python + Django, Ruby on Rails, Node + PostgreSQL]

I'm learning, so explain each part simply.
2 views 0 copies