NOSSLETTER.techLIVE
back to OSSpedia

[ TOPIC ]

query-optimization

16 real merged PRs across 4 projects, ordered easiest to hardest. Read them in order to see how query-optimization shows up in production code, then go deeper with the free papers and talks below.

[ 01 // REAL PRs ]

Next (mid) · 6

milvus-io/milvus8/10

fix: support vector output with order_by

This PR teaches how to handle late materialization of complex data types (like vectors) in query execution plans to support efficient ORDER BY queries with vector outputs.

midquery-optimizationdata-structuresalgorithmic-optimization
duckdb/duckdb8/10

Fixes (#24115) : Use single-column ART index scan for IS NOT DISTINCT FROM

This PR teaches how to extend an index scan optimization to support SQL's IS NOT DISTINCT FROM, including handling of NULL semantics and verifying correctness with targeted tests.

midindexingquery-optimizationtesting-strategy
duckdb/duckdb8/10

Prune row groups for column-constant OR

This PR teaches how to optimize query execution by pruning row groups using cross-column OR predicates and demonstrates careful test coverage and code review for correctness and maintainability.

midquery-optimizationdata-structuresalgorithmic-optimizationtesting-strategy
duckdb/duckdb8/10

Prune row groups when an IN-list covers the whole zonemap rangend add

This PR teaches how to use zonemap statistics and IN-list analysis to optimize query execution by pruning unnecessary row group scans, including careful handling of edge cases and robust testing.

midquery-optimizationdata-structurestesting-strategy
duckdb/duckdb8/10

Fix statistics propagation for window aggregate functions (#23663)

This PR teaches how to correctly propagate statistics for window aggregate functions in a query optimizer, including how to structure callbacks and tests for stats-dependent aggregates.

midquery-optimizationdata-structurestesting-strategy
milvus-io/milvus7/10

fix: validate MATCH predicates are element-level [3.0]

This PR demonstrates how to robustly validate and test element-level match predicates in a query engine, ensuring correctness and preventing subtle errors in predicate evaluation.

midquery-optimizationerror-handlingtesting-strategy

Go deep (senior) · 10

ClickHouse/ClickHouse9/10

Fix RIGHT JOIN with parallel_replicas_min_number_of_rows_per_replica

This PR teaches how to correctly handle query plan analysis reuse in parallel query execution, especially for RIGHT JOINs, to avoid subtle cross-table errors and demonstrates robust regression testing for distributed SQL engines.

seniorparallelismquery-optimizationerror-handlingtesting-strategy
ClickHouse/ClickHouse9/10

Fix wrong `ORDER BY` results for `Merge` over `Distributed`

This PR teaches how distributed query engines must carefully preserve stream ordering to ensure correct results for ORDER BY and LIMIT, and how to write regression tests for subtle distributed query bugs.

seniorquery-optimizationconsistency-modelsdata-structurestesting-strategy
duckdb/duckdb9/10

Add multiplicity-aware combine support and fix LIST state combination

This PR teaches how to correctly handle aggregate state combination with multiplicities in query optimizations, especially for list-backed aggregates, and demonstrates robust testing and plan stability practices.

senioralgorithmic-optimizationdata-structuresquery-optimizationtesting-strategy
pingcap/tidb8/10

planner: support TiFlash MPP full outer join

This PR demonstrates how to extend a distributed SQL planner to support full outer joins in MPP (Massively Parallel Processing) mode, including join type validation, plan enumeration, and serialization for execution engines like TiFlash.

seniorquery-optimizationdistributed-systemsconsistency-models
pingcap/tidb8/10

planner: fix countAfterAccess for IndexJoin in Skyline Pruning Comparison (#70791)

This PR teaches how to accurately estimate row counts for index join candidates in a query planner by adjusting for join key NDV, ensuring fair comparison and optimal index selection during skyline pruning.

seniorquery-optimizationalgorithmic-optimizationdata-structures
pingcap/tidb8/10

planner: keep min/max row estimates aligned after correlated column split (#70793)

This PR demonstrates how to maintain consistent row estimate bounds for correlated index paths during query optimization to avoid incorrect pruning, including the reasoning and regression test coverage needed for robust planner changes.

seniorquery-optimizationalgorithmic-optimizationdata-structures
pingcap/tidb8/10

planner: fix countAfterAccess for IndexJoin in Skyline Pruning Comparison

This PR teaches how to adjust row count estimation for index join selection in a query optimizer by accounting for join key NDV, ensuring fairer candidate comparison and demonstrating robust regression testing for plan choice correctness.

seniorquery-optimizationalgorithmic-optimizationdata-structures
ClickHouse/ClickHouse8/10

Fix missing materialized-CTE gate when a `Merge` table has several children

This PR teaches how to safely manage and optimize materialized CTE ownership across multiple query plan branches to prevent subtle concurrency and correctness bugs in complex query engines.

seniorquery-optimizationdata-structureserror-handling
ClickHouse/ClickHouse8/10

Fix wrong results with parallel_hash JOIN and read-in-order-through-join

This PR teaches how to reason about and enforce data stream order preservation through different join algorithms to ensure correctness of downstream query optimizations that rely on sorted input.

seniorquery-optimizationalgorithmic-optimizationconsistency-models
duckdb/duckdb8/10

Fix Top-N window elimination for nullable ordering expressions

This PR teaches how to conservatively analyze SQL expression nullability to ensure correctness in query optimization, especially when rewriting window functions with potentially nullable ordering expressions.

seniorquery-optimizationalgorithmic-optimizationerror-handling

[ 02 // MUST-READ PAPERS ]

Free to read, ranked by citations.

[ 03 // FREE VIDEOS & TALKS ]

Ranked by views.

other topics