Part 3 of 5 · 1 min read
Logical plan
A plan describing what the query needs, in terms of relational operations, without saying how to do it yet.
Think of a recipe that lists "combine the flour and eggs, then bake," without yet saying which specific bowl, mixer, or oven to use.
In plain words: a logical plan describes a query purely in terms of relational operations, such as selecting rows matching a condition, joining two tables, or grouping rows by a column, without committing to any specific algorithm or index for carrying each operation out. It represents what the query needs, structured as a tree of these operations, built directly from the parsed statement.
A worked example. The logical plan for SELECT * FROM orders WHERE customer_id = 42; says "filter the orders relation where customer_id = 42," without yet deciding whether that filter will be satisfied by a full scan or an index lookup.
The key lines. No new SQL; the logical plan is an internal structure built from the parsed statement, not something a query directly inspects.
Logical plan
A logical plan describes a query as a tree of relational operations, such as filter, join, or group, stating what the query needs without committing to any specific algorithm or index.
Example: a recipe listing "combine the flour and eggs, then bake," without naming a specific bowl or oven, is a logical plan for a dish.