More Polars plan optimizations for TPC-DS#22395
Draft
Matt711 wants to merge 2 commits intorapidsai:mainfrom
Draft
More Polars plan optimizations for TPC-DS#22395Matt711 wants to merge 2 commits intorapidsai:mainfrom
Matt711 wants to merge 2 commits intorapidsai:mainfrom
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Hand-tune
polars_implfor 19 TPC-DS benchmark queries inpython/cudf_polars/cudf_polars/experimental/benchmarks/pdsds_queries/. Each rewrite preserves query semantics and only changes how the polars LazyFrame is constructed;duckdb_implis unchanged.The optimizations apply a small set of recurring patterns that the polars optimizer does not (yet) perform automatically:
date_dim,item,store, etc. by literal predicates (year, quarter, month window, category/class/brand) before any join, so the join builds smaller hash tables.store_returns(customer, item) pairs) as semi-join probes against the fact tables, shrinking them before the expensive joins.select(...)only the columns each table contributes before joining, instead of relying on the planner to prune them later.Test plan
Checklist