Skip to content
Databases in Practice

What is EXPLAIN Query Plan?

The command prefix showing how the database will execute a query: scan types, index usage, join order, and row estimates. Reading plans separates “add an index” guesses from evidence about what the planner actually does.

Example

A BYOB Supabase project serves chat history through RLS policies; EXPLAIN shows a sequential scan on messages, so the team adds a conversation-scoped index and re-checks until the plan shows an index scan.

What people get wrong

Adding indexes blindly for every slow query. Unused indexes slow every write and bloat backups; measure with EXPLAIN first, then index deliberately.

Sources

Browse all Databases in Practice terms →