Overview of YouTrackDB Planner Open Problems
developThe current generation of the YouTrackDB cost-based planner is designed to be correct and fast for common cases, but it relies on coarse estimates and greedy search patterns. For developers looking to contribute, the project has identified several key areas for 'second generation' improvements. These improvements are interconnected, with some serving as foundations for others.
Key areas for contribution include:
- Cardinality Estimation (v2): Improving how the engine estimates record counts (addressing triples, skew, and correlation).
- Join Order Enumeration: Moving from greedy DFS to a more robust IDP enumerative planner.
- Stats-drift Management: Implementing plan-cache invalidation when statistics change.
- Hash-join Improvements: Adding spill-to-disk capabilities.
- EXPLAIN Observability: Enhancing the ability to debug and observe the planner's decisions.
If you are looking for the lowest-risk entry point to contribute, the documentation recommends starting with EXPLAIN observability (§18.5), as it makes all other improvements easier to measure and debug.