Database Kernel (1): Bind Is Semantic Analysis, Not Syntax Checking

People often assume SQL parsing means “turn the string into a tree” and then execution can start. The step in between — bind — is the most underrated: it decides which table and column every name refers to, in which scope. This is the first post in the plan implementation series: what bind does, and why the order matters. 1. Four components Component Role Builder The driver for semantic analysis, one per select; also holds partial results BindContext A scope: which relations are visible here; scopes nest Binding The definition of a relation (table or subquery) and its columns Expr Everything except relations becomes an expression The key design is nested BindContexts: a subquery isn’t “a new parser”, it’s a new scope on top of the parent. Name lookup walks up until it finds something or errors. ...

October 22, 2026 · 3 min · daviszhen