Anatomy of a SQL Engine
Published on: 2025-08-07 05:00:40
May marks five years since Dolt adopted go-mysql-server. Today we summarize the current state of GMS by walking through a query's journey from parsing to result spooling.
Overview
SQL engines are the logical layer of a database that sit between client and storage. To mutate the database state on behalf of a client, a SQL engine performs the following steps:
Parsing Binding Plan Simplification Join Exploration Plan Costing Execution Spooling Results
Most systems also have a variety of execution strategies (row vs vector based) and infrastructure layers (run locally vs distributed). At the moment Dolt's engine by default uses row-based execution within the local server.
Parsing
The first thing a SQL Engine does when receiving a query is try to form a structured abstract syntax tree (AST). The AST is a rough cut of whether the query is well formed. The entrypoint of the parser is here.
A client driver initializes a query by passing bytes over the network through a server listener i
... Read full article.