First Past the Post: Evaluating Query Optimization in MongoDB
Dawei Tao, Enqi Liu, Sidath Randeni Kadupitige, Michael Cahill, Alan, Fekete, Uwe R\"ohm

TL;DR
This paper evaluates MongoDB's 'first past the post' query optimization approach, revealing its preference bias and suboptimal plan choices, which can significantly impact query performance.
Contribution
It provides an analysis of MongoDB's FPTP optimizer, visualizes its effectiveness, and identifies causes of its suboptimal plan selections.
Findings
FPTP often prefers index scans over collection scans, even when slower.
The optimizer can select plans with over twice the runtime of the optimal plan.
Identifies bias causes leading to suboptimal query plan choices.
Abstract
Query optimization is crucial for every database management system (DBMS) to enable fast execution of declarative queries. Most DBMS designs include cost-based query optimization. However, MongoDB implements a different approach to choose an execution plan that we call "first past the post" (FPTP) query optimization. FPTP does not estimate costs for each execution plan, but rather partially executes the alternative plans in a round-robin race and observes the work done by each relative to the number of records returned. In this paper, we analyze the effectiveness of MongoDB's FPTP query optimizer. We see whether the optimizer chooses the best execution plan among the alternatives and measure how the chosen plan compares to the optimal plan. We also show how to visualize the effectiveness and identify situations where the MongoDB 7.0.1 query optimizer chooses suboptimal query plans.…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Taxonomy
TopicsCloud Computing and Resource Management · IoT and Edge/Fog Computing · Advanced Database Systems and Queries
