Index Ai Academy
Glossary · Phase 7 · Software engineering

N+1 query problem

Also written: N+1 queries

Running one database query for a list, then another for every item in it, instead of one combined query.

Try it now

Most code doesn't need to be fast. Find the bit that does.

Learn it properly

Performance and profiling · Measure before you optimize, then fix the part that matters. About 35 minutes.

Create a free account See what's in the lesson

Other terms from the same lesson

Never trained an AI?

Teach a small one to write, right in your browser. It takes about 20 seconds and needs no account.

Teach it to write