What is a query planner?
Dec 15, 2022Andres Taylor

Summary
This post provides a detailed explanation of the query planning process in database systems, drawing parallels to compiler design. It breaks down the process into lexing/parsing, semantic analysis, optimization, and code generation. For optimization, it specifically discusses predicate rewriting and join order selection, using examples from Vitess. It also highlights Vitess's strategy of pushing down work to MySQL and performing aggregations in stages. The post emphasizes the critical role of a good query planner in database performance.