Quarantine DB Talk 2020: CockroachDB’s Query Optimizer

Event Date: Monday September 28, 2020
Event Time: 05:00pm EDT
Speaker: Rebecca Taft [INFO]

Title: CockroachDB's Query Optimizer

We live in an increasingly interconnected world, with many organizations operating across countries or even continents. To serve their global user base, organizations are replacing their legacy DBMSs with cloud-based systems capable of scaling OLTP workloads to millions of users. CockroachDB is a scalable SQL DBMS that was built from the ground up to support these global OLTP workloads while maintaining high availability and strong consistency. Just like its namesake, CockroachDB is resilient to disasters through replication and automatic recovery mechanisms.

In this talk, I’ll give a brief introduction to the architecture of CockroachDB followed by a deep dive into the design and implementation of CockroachDB’s query optimizer. CockroachDB has a Cascades-style query optimizer that uses over 200 transformation rules to explore the space of possible query execution plans. In this talk, I’ll describe the domain-specific language, Optgen, that we use to define these transformation rules, and demonstrate how the rules work in action. I’ll explain how we use statistics to choose the best plan from the search space, and how we automatically collect stats without disrupting production workloads or requiring coordination between nodes. I’ll also describe some of the unique challenges we face when optimizing queries for a geo-distributed environment, and how CockroachDB handles them.

This talk is part of the Quarantine Database Tech Talk Seminar Series.

Zoom Link: (Password 264771)

Becca is a Staff Engineer at Cockroach Labs where she is a member of the SQL query optimizer team. Prior to joining Cockroach Labs, she was a graduate student at MIT, where she worked with Professor Michael Stonebraker researching distributed database elasticity and multi-tenancy. Becca holds a B.S. in Physics from Yale University and an M.S. and Ph.D. in Computer Science from MIT. In her free time, she enjoys rowing on the Chicago River and enjoying the great outdoors.

More Info: