AlgoPlus//databases / query-plan
Read the theory

Query Plan

A SQL query becomes a tree of operators that executes bottom-up — watch the rows flow.

Step
Phase
Running
Legend
Executing / done operator
Not yet run
AI Tutor Workspace
In a nutshell
SQL is declarative: you describe the result you want, and the database's optimizer decides how to get it. It compiles your query into a plan — a tree of operators like scan, join, filter, and sort — and runs it bottom-up, each operator feeding rows to its parent. The fewer rows each step touches, the cheaper the query.
Ready
Press play to begin the cinematic walkthrough.
SQL is declarative — you say what you want, the planner decides how. It builds a tree of operators and runs it bottom-up, each one feeding rows to its parent.
Key terms
Go deeper in the lesson
Read the full theory, intuition & complexity for Query Plan.