The document describes the Volcano/Cascades query optimizer. It uses dynamic programming to efficiently search the large space of possible query execution plans. The optimizer represents queries as logical and physical operators connected by transformation and implementation rules. It explores the logical plan space and then builds physical plans by applying these rules. The search is guided by estimating physical operator costs. The optimizer memoizes partial results to avoid redundant work. This approach allows finding optimal execution plans in a principled way that scales to complex queries and optimizer extensions.