Results depend on the tool, the model and what you enter.
Fill in
What you type stays in this browser window. We store and send nothing.
Where do you look?
API handler
background job
report export
admin list
mixed
Which pattern?
ORM with lazy load
manual queries
GraphQL resolvers
repository layer
unclear
What stands out?
latency grows with list length
many identical SELECTs
timeout under load
prevention in review
new after a feature merge
Your prompt
Help me find and fix N+1 queries in my code.
Place: [Place]
ORM: [ORM]
Symptom: [Symptom]
Steps: 1. Read the code or trace that loads a list and then fetches more data per item. 2. Count how many follow-up queries a typical page or batch triggers. 3. Flag missing preloads, missing joins and loops with single fetches. 4. Propose batched queries, joins or targeted preloading and name risks of oversized results. 5. Define metrics that show the improvement. 6. Write a short fix plan with a test idea.
Output: finding list, estimated round trips, fix proposals and test idea.
Take particular care to load lists with their relations instead of refetching per item, and measure round trips.
Before you answer, check: Are all instructions met? If key information is missing or a placeholder in square brackets is still in the text, ask instead of guessing. Mark assumptions as assumptions.
You have edited the prompt. Changes in the fields above no longer overwrite it.
This is an instruction for an AI, not the result itself.
Prompt that plans a data backfill in small, resumable batches with clear brakes.
Prompt · Intermediate · about 15 min
You may use our prompts freely, including at work. Please do not republish them as your own collection. We give no warranty for AI results; check them yourself. Terms of use