Skip to content

More Polars plan optimizations for TPC-DS - #22395

Merged
rapids-bot[bot] merged 4 commits into
NVIDIA:release/26.06from
Matt711:imp/pdsds/more-pds-optimizations
May 19, 2026
Merged

More Polars plan optimizations for TPC-DS#22395
rapids-bot[bot] merged 4 commits into
NVIDIA:release/26.06from
Matt711:imp/pdsds/more-pds-optimizations

Conversation

@Matt711

@Matt711 Matt711 commented May 6, 2026

Copy link
Copy Markdown
Member

Description

Hand-tune polars_impl for 19 TPC-DS benchmark queries in python/cudf_polars/cudf_polars/experimental/benchmarks/pdsds_queries/. Each rewrite preserves query semantics and only changes how the polars LazyFrame is constructed; duckdb_impl is unchanged.

The optimizations apply a small set of recurring patterns that the polars optimizer does not (yet) perform automatically:

  • Predicate pushdown on dimension tables — pre-filter 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.
  • Semi-join fact-table pre-filtering — use selective dimension keys (and in some cases store_returns (customer, item) pairs) as semi-join probes against the fact tables, shrinking them before the expensive joins.
  • Projection pushdownselect(...) only the columns each table contributes before joining, instead of relying on the planner to prune them later.
  • Condition-join → equi-join — replace cross-join + filter and CONDITIONALJOIN-style patterns with constant-key equi-joins where the predicate is equivalent.
  • Single-pass bucket aggregation — collapse multiple independent global-sum group-bys over the same fact table into one pass that emits the values in a single aggregation, replacing N scans with 1.
  • Join reordering — defer non-selective joins (e.g. customer) until after the selective filter chain so the row count entering the deferred join is much smaller.

Test plan

  • Run TPC-DS validation against DuckDB on the 19 modified queries
  • Run benchmark sweep and confirm no regressions vs. main on unmodified queries
  • Confirm result equality (sorted output) matches DuckDB reference

Checklist

  • I am familiar with the Contributing Guidelines.
  • New or existing tests cover these changes.
  • The documentation is up to date with these changes.

@Matt711 Matt711 added Performance Performance related issue improvement Improvement / enhancement to an existing function non-breaking Non-breaking change labels May 6, 2026
@copy-pr-bot

copy-pr-bot Bot commented May 6, 2026

Copy link
Copy Markdown

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@github-actions github-actions Bot added Python Affects Python cuDF API. cudf-polars Issues specific to cudf-polars labels May 6, 2026
@GPUtester GPUtester moved this to In Progress in cuDF Python May 6, 2026
@Matt711
Matt711 marked this pull request as ready for review May 13, 2026 18:11
@Matt711
Matt711 requested a review from a team as a code owner May 13, 2026 18:11
@Matt711
Matt711 requested a review from rjzamora May 13, 2026 18:11
@coderabbitai

coderabbitai Bot commented May 13, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Summary by CodeRabbit

  • Refactor
    • Optimized multiple benchmark query implementations by reorganizing join operations and applying filters earlier in the pipeline, reducing computation on larger datasets before expensive joins occur. No API changes.

Walkthrough

Across 16 TPC-DS benchmark queries, the Polars implementations shift from "join full dimension/fact tables then apply filters" to "pre-filter and project dimensions early, use semi-joins to reduce cardinality, derive key pairs, and reorder aggregation stages for earlier row reduction". No exported signatures change; all modifications are internal optimization refactors.

Changes

Polars Query Optimization Pattern

Layer / File(s) Summary
Basic dimension pre-filtering and projection
python/cudf_polars/cudf_polars/streaming/benchmarks/pdsds_queries/q43.py, q52.py, q55.py, q63.py, q67.py, q8.py, q76.py
Filter date_dim by year/month/day predicates and store/item by category/manager/offset conditions; project only join keys and aggregation columns. Join pre-filtered frames to store_sales instead of joining unfiltered tables and filtering later. q76 additionally simplifies aggregation from conditional count()>0 to direct sum().
Date window filtering and temporal aggregation restructuring
python/cudf_polars/cudf_polars/streaming/benchmarks/pdsds_queries/q2.py, q23.py
Pre-filter date_dim to target year windows and project only needed date keys. Refactor weekday/week aggregations from week-scaffolding + count-based null handling to single-pass conditional sum() expressions grouped by d_week_seq. Reorganize frequent_ss_items and customer_sales to filter dates before joining item.
Fact-pair derivation and semi-join pre-qualification
python/cudf_polars/cudf_polars/streaming/benchmarks/pdsds_queries/q14.py, q17.py, q25.py, q29.py, q98.py
From filtered fact tables (e.g., store_returns), extract (customer, item, ticket) key pairs and cache. Use semi-joins to pre-filter related facts before expensive joins: store_sales and catalog_sales reduced by date windows and key-pair membership. Select aggregation columns after pre-filters, removing redundant projections in final join chain.
Join reordering, bucketing, and aggregation flow changes
python/cudf_polars/cudf_polars/streaming/benchmarks/pdsds_queries/q18.py, q44.py, q53.py, q88.py, q9.py
Reorder joins to apply semi joins and key qualifiers before aggregations; move customer/item/date reductions before expensive group-by operations. Introduce bucket assignment (quantile ranges or threshold-based) and aggregate per bucket, then pivot/rank/assemble results. Replace cross-joins with equi-joins on constant keys. Simplify benchmark computation and use rank(method="min") for ranking stages.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

  • rapidsai/cudf#22473: Modifies Polars Query 8's zip-prefix join logic in q8.py, using pre-computed s_zip_prefix keys instead of inline slice operations.

Suggested reviewers

  • rjzamora
  • wence-
  • mroeschke
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title 'More Polars plan optimizations for TPC-DS' directly and clearly summarizes the main change: additional query plan optimizations for TPC-DS benchmark queries using Polars.
Description check ✅ Passed The description is comprehensive and well-related to the changeset, explaining the hand-tuned Polars optimizations, the specific patterns applied, and the test plan for 19 TPC-DS queries.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@python/cudf_polars/cudf_polars/experimental/benchmarks/pdsds_queries/q44.py`:
- Line 121: The ranking uses Polars' ordinal method which gives unique ranks and
diverges from SQL RANK() semantics; update both occurrences where
pl.col("avg_profit").rank(method="ordinal").alias("rnk") is used (and any
subsequent filters like rnk < 11) to use method="min" instead so tied avg_profit
values receive the same rank with gaps (matching DuckDB/SQL RANK behavior).

In `@python/cudf_polars/cudf_polars/experimental/benchmarks/pdsds_queries/q76.py`:
- Line 177: The aggregation pl.col("ext_sales_price").sum().alias("sales_amt")
returns 0 for all-null groups in Polars, which differs from SQL/DuckDB; replace
this with a conditional aggregation that checks
pl.col("ext_sales_price").count() > 0 and only returns the sum when count>0,
otherwise returns None, mirroring the null-sum handling used in q1/q49 so that
the "sales_amt" column matches SQL semantics.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 4b334632-2668-4f86-af10-2ff2b1dba11b

📥 Commits

Reviewing files that changed from the base of the PR and between ff37ba8 and e94077b.

📒 Files selected for processing (19)
  • python/cudf_polars/cudf_polars/experimental/benchmarks/pdsds_queries/q14.py
  • python/cudf_polars/cudf_polars/experimental/benchmarks/pdsds_queries/q17.py
  • python/cudf_polars/cudf_polars/experimental/benchmarks/pdsds_queries/q18.py
  • python/cudf_polars/cudf_polars/experimental/benchmarks/pdsds_queries/q2.py
  • python/cudf_polars/cudf_polars/experimental/benchmarks/pdsds_queries/q23.py
  • python/cudf_polars/cudf_polars/experimental/benchmarks/pdsds_queries/q25.py
  • python/cudf_polars/cudf_polars/experimental/benchmarks/pdsds_queries/q29.py
  • python/cudf_polars/cudf_polars/experimental/benchmarks/pdsds_queries/q43.py
  • python/cudf_polars/cudf_polars/experimental/benchmarks/pdsds_queries/q44.py
  • python/cudf_polars/cudf_polars/experimental/benchmarks/pdsds_queries/q52.py
  • python/cudf_polars/cudf_polars/experimental/benchmarks/pdsds_queries/q53.py
  • python/cudf_polars/cudf_polars/experimental/benchmarks/pdsds_queries/q55.py
  • python/cudf_polars/cudf_polars/experimental/benchmarks/pdsds_queries/q63.py
  • python/cudf_polars/cudf_polars/experimental/benchmarks/pdsds_queries/q67.py
  • python/cudf_polars/cudf_polars/experimental/benchmarks/pdsds_queries/q76.py
  • python/cudf_polars/cudf_polars/experimental/benchmarks/pdsds_queries/q8.py
  • python/cudf_polars/cudf_polars/experimental/benchmarks/pdsds_queries/q88.py
  • python/cudf_polars/cudf_polars/experimental/benchmarks/pdsds_queries/q9.py
  • python/cudf_polars/cudf_polars/experimental/benchmarks/pdsds_queries/q98.py

Comment thread python/cudf_polars/cudf_polars/experimental/benchmarks/pdsds_queries/q44.py Outdated
@Matt711
Matt711 force-pushed the imp/pdsds/more-pds-optimizations branch from e94077b to e1bb3be Compare May 14, 2026 02:02

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (2)
python/cudf_polars/cudf_polars/experimental/benchmarks/pdsds_queries/q25.py (1)

121-121: ⚡ Quick win

Deduplicate the semi-join probe keys.

Same pattern here: sr_customer_item is acting as an existence set for two semi joins, so keeping duplicate (sr_customer_sk, sr_item_sk) rows only makes the join builds heavier. A .unique() should make the prefilter cheaper without changing semantics.

♻️ Proposed change
-    sr_customer_item = store_returns_filtered.select(["sr_customer_sk", "sr_item_sk"])
+    sr_customer_item = store_returns_filtered.select(
+        ["sr_customer_sk", "sr_item_sk"]
+    ).unique()
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@python/cudf_polars/cudf_polars/experimental/benchmarks/pdsds_queries/q25.py`
at line 121, sr_customer_item currently keeps duplicate (sr_customer_sk,
sr_item_sk) rows used as an existence set for two semi-joins; make the prefilter
cheaper by deduplicating it. Update the assignment for sr_customer_item (from
store_returns_filtered.select(["sr_customer_sk", "sr_item_sk"])) to call
.unique() (or the equivalent drop_duplicates()) on the resulting frame so
duplicates are removed before using sr_customer_item in the semi-joins.
python/cudf_polars/cudf_polars/experimental/benchmarks/pdsds_queries/q29.py (1)

126-126: ⚡ Quick win

Deduplicate the semi-join probe keys.

sr_customer_item is only used as the RHS of how="semi" joins, so duplicate (sr_customer_sk, sr_item_sk) pairs cannot change results but can still bloat both downstream join builds. Adding .unique() here should reduce the work in the hottest part of this rewrite.

♻️ Proposed change
-    sr_customer_item = store_returns_filtered.select(["sr_customer_sk", "sr_item_sk"])
+    sr_customer_item = store_returns_filtered.select(
+        ["sr_customer_sk", "sr_item_sk"]
+    ).unique()
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@python/cudf_polars/cudf_polars/experimental/benchmarks/pdsds_queries/q29.py`
at line 126, sr_customer_item currently selects ["sr_customer_sk","sr_item_sk"]
from store_returns_filtered but is only used as the RHS of semi-joins
(how="semi"), so duplicate (sr_customer_sk, sr_item_sk) pairs only bloat
downstream joins; change the creation to deduplicate the probe keys by applying
.unique() to the selection (i.e., replace the current
store_returns_filtered.select([...]) usage for sr_customer_item with
store_returns_filtered.select([...]).unique()) so the semi-join builds operate
on distinct keys.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@python/cudf_polars/cudf_polars/experimental/benchmarks/pdsds_queries/q25.py`:
- Line 121: sr_customer_item currently keeps duplicate (sr_customer_sk,
sr_item_sk) rows used as an existence set for two semi-joins; make the prefilter
cheaper by deduplicating it. Update the assignment for sr_customer_item (from
store_returns_filtered.select(["sr_customer_sk", "sr_item_sk"])) to call
.unique() (or the equivalent drop_duplicates()) on the resulting frame so
duplicates are removed before using sr_customer_item in the semi-joins.

In `@python/cudf_polars/cudf_polars/experimental/benchmarks/pdsds_queries/q29.py`:
- Line 126: sr_customer_item currently selects ["sr_customer_sk","sr_item_sk"]
from store_returns_filtered but is only used as the RHS of semi-joins
(how="semi"), so duplicate (sr_customer_sk, sr_item_sk) pairs only bloat
downstream joins; change the creation to deduplicate the probe keys by applying
.unique() to the selection (i.e., replace the current
store_returns_filtered.select([...]) usage for sr_customer_item with
store_returns_filtered.select([...]).unique()) so the semi-join builds operate
on distinct keys.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 800a9d03-24c5-465a-8998-3ee5af1eaa20

📥 Commits

Reviewing files that changed from the base of the PR and between e94077b and e1bb3be.

📒 Files selected for processing (19)
  • python/cudf_polars/cudf_polars/experimental/benchmarks/pdsds_queries/q14.py
  • python/cudf_polars/cudf_polars/experimental/benchmarks/pdsds_queries/q17.py
  • python/cudf_polars/cudf_polars/experimental/benchmarks/pdsds_queries/q18.py
  • python/cudf_polars/cudf_polars/experimental/benchmarks/pdsds_queries/q2.py
  • python/cudf_polars/cudf_polars/experimental/benchmarks/pdsds_queries/q23.py
  • python/cudf_polars/cudf_polars/experimental/benchmarks/pdsds_queries/q25.py
  • python/cudf_polars/cudf_polars/experimental/benchmarks/pdsds_queries/q29.py
  • python/cudf_polars/cudf_polars/experimental/benchmarks/pdsds_queries/q43.py
  • python/cudf_polars/cudf_polars/experimental/benchmarks/pdsds_queries/q44.py
  • python/cudf_polars/cudf_polars/experimental/benchmarks/pdsds_queries/q52.py
  • python/cudf_polars/cudf_polars/experimental/benchmarks/pdsds_queries/q53.py
  • python/cudf_polars/cudf_polars/experimental/benchmarks/pdsds_queries/q55.py
  • python/cudf_polars/cudf_polars/experimental/benchmarks/pdsds_queries/q63.py
  • python/cudf_polars/cudf_polars/experimental/benchmarks/pdsds_queries/q67.py
  • python/cudf_polars/cudf_polars/experimental/benchmarks/pdsds_queries/q76.py
  • python/cudf_polars/cudf_polars/experimental/benchmarks/pdsds_queries/q8.py
  • python/cudf_polars/cudf_polars/experimental/benchmarks/pdsds_queries/q88.py
  • python/cudf_polars/cudf_polars/experimental/benchmarks/pdsds_queries/q9.py
  • python/cudf_polars/cudf_polars/experimental/benchmarks/pdsds_queries/q98.py
🚧 Files skipped from review as they are similar to previous changes (17)
  • python/cudf_polars/cudf_polars/experimental/benchmarks/pdsds_queries/q76.py
  • python/cudf_polars/cudf_polars/experimental/benchmarks/pdsds_queries/q52.py
  • python/cudf_polars/cudf_polars/experimental/benchmarks/pdsds_queries/q67.py
  • python/cudf_polars/cudf_polars/experimental/benchmarks/pdsds_queries/q53.py
  • python/cudf_polars/cudf_polars/experimental/benchmarks/pdsds_queries/q17.py
  • python/cudf_polars/cudf_polars/experimental/benchmarks/pdsds_queries/q8.py
  • python/cudf_polars/cudf_polars/experimental/benchmarks/pdsds_queries/q9.py
  • python/cudf_polars/cudf_polars/experimental/benchmarks/pdsds_queries/q98.py
  • python/cudf_polars/cudf_polars/experimental/benchmarks/pdsds_queries/q88.py
  • python/cudf_polars/cudf_polars/experimental/benchmarks/pdsds_queries/q14.py
  • python/cudf_polars/cudf_polars/experimental/benchmarks/pdsds_queries/q43.py
  • python/cudf_polars/cudf_polars/experimental/benchmarks/pdsds_queries/q23.py
  • python/cudf_polars/cudf_polars/experimental/benchmarks/pdsds_queries/q63.py
  • python/cudf_polars/cudf_polars/experimental/benchmarks/pdsds_queries/q55.py
  • python/cudf_polars/cudf_polars/experimental/benchmarks/pdsds_queries/q44.py
  • python/cudf_polars/cudf_polars/experimental/benchmarks/pdsds_queries/q2.py
  • python/cudf_polars/cudf_polars/experimental/benchmarks/pdsds_queries/q18.py

@Matt711

Matt711 commented May 14, 2026

Copy link
Copy Markdown
Member Author

/ok to test f1a800d

@Matt711
Matt711 changed the base branch from main to release/26.06 May 18, 2026 15:54
@Matt711

Matt711 commented May 18, 2026

Copy link
Copy Markdown
Member Author

/ok to test 6a216d1

@Matt711
Matt711 force-pushed the imp/pdsds/more-pds-optimizations branch from 6a216d1 to ed3e928 Compare May 19, 2026 15:02
@Matt711

Matt711 commented May 19, 2026

Copy link
Copy Markdown
Member Author

/ok to test ed3e928

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
python/cudf_polars/cudf_polars/streaming/benchmarks/pdsds_queries/q2.py (1)

180-195: ⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Join to date_dim may produce duplicate rows per d_week_seq.

date_dim contains ~7 rows per d_week_seq (one per day). Since wswscs has one row per d_week_seq, joining it to the full date_dim on d_week_seq will duplicate each aggregated row ~7 times. The subsequent .filter(pl.col("d_year") == year) doesn't deduplicate.

To preserve semantics, join against a deduplicated mapping:

Proposed fix
+    # One row per week: pick the year of that week (any day in the week has the same d_year).
+    week_to_year = date_dim.select(["d_week_seq", "d_year"]).unique(subset=["d_week_seq"])
+
     # Step 3: Create year data (y subquery equivalent)
     y_year = (
-        wswscs.join(date_dim, left_on="d_week_seq", right_on="d_week_seq")
+        wswscs.join(week_to_year, on="d_week_seq")
         .filter(pl.col("d_year") == year)
         .select(
             [
                 pl.col("d_week_seq").alias("d_week_seq1"),

The same issue applies to z_year_plus_1 at lines 197-212.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@python/cudf_polars/cudf_polars/streaming/benchmarks/pdsds_queries/q2.py`
around lines 180 - 195, The join between wswscs and date_dim (used to build
y_year and z_year_plus_1) currently multiplies rows because date_dim has
multiple rows per d_week_seq; instead create a deduplicated mapping of date_dim
keyed by d_week_seq with the d_year (e.g., select d_week_seq and d_year and call
unique()/drop_duplicates()) and join wswscs to that deduped Date mapping before
filtering by pl.col("d_year") == year (and similarly for the z_year_plus_1
path), ensuring you reference the variables/expressions y_year, z_year_plus_1,
wswscs, date_dim and the join key d_week_seq when making the change.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Outside diff comments:
In `@python/cudf_polars/cudf_polars/streaming/benchmarks/pdsds_queries/q2.py`:
- Around line 180-195: The join between wswscs and date_dim (used to build
y_year and z_year_plus_1) currently multiplies rows because date_dim has
multiple rows per d_week_seq; instead create a deduplicated mapping of date_dim
keyed by d_week_seq with the d_year (e.g., select d_week_seq and d_year and call
unique()/drop_duplicates()) and join wswscs to that deduped Date mapping before
filtering by pl.col("d_year") == year (and similarly for the z_year_plus_1
path), ensuring you reference the variables/expressions y_year, z_year_plus_1,
wswscs, date_dim and the join key d_week_seq when making the change.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 515ffcbe-e4e2-4528-afa8-400ffb783f8c

📥 Commits

Reviewing files that changed from the base of the PR and between f1a800d and ed3e928.

📒 Files selected for processing (19)
  • python/cudf_polars/cudf_polars/streaming/benchmarks/pdsds_queries/q14.py
  • python/cudf_polars/cudf_polars/streaming/benchmarks/pdsds_queries/q17.py
  • python/cudf_polars/cudf_polars/streaming/benchmarks/pdsds_queries/q18.py
  • python/cudf_polars/cudf_polars/streaming/benchmarks/pdsds_queries/q2.py
  • python/cudf_polars/cudf_polars/streaming/benchmarks/pdsds_queries/q23.py
  • python/cudf_polars/cudf_polars/streaming/benchmarks/pdsds_queries/q25.py
  • python/cudf_polars/cudf_polars/streaming/benchmarks/pdsds_queries/q29.py
  • python/cudf_polars/cudf_polars/streaming/benchmarks/pdsds_queries/q43.py
  • python/cudf_polars/cudf_polars/streaming/benchmarks/pdsds_queries/q44.py
  • python/cudf_polars/cudf_polars/streaming/benchmarks/pdsds_queries/q52.py
  • python/cudf_polars/cudf_polars/streaming/benchmarks/pdsds_queries/q53.py
  • python/cudf_polars/cudf_polars/streaming/benchmarks/pdsds_queries/q55.py
  • python/cudf_polars/cudf_polars/streaming/benchmarks/pdsds_queries/q63.py
  • python/cudf_polars/cudf_polars/streaming/benchmarks/pdsds_queries/q67.py
  • python/cudf_polars/cudf_polars/streaming/benchmarks/pdsds_queries/q76.py
  • python/cudf_polars/cudf_polars/streaming/benchmarks/pdsds_queries/q8.py
  • python/cudf_polars/cudf_polars/streaming/benchmarks/pdsds_queries/q88.py
  • python/cudf_polars/cudf_polars/streaming/benchmarks/pdsds_queries/q9.py
  • python/cudf_polars/cudf_polars/streaming/benchmarks/pdsds_queries/q98.py

@TomAugspurger TomAugspurger left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I haven't run these to confirm that validation still passes, but I'll assume you have ;)

One general question: Your PR description has a nice categorization of the different optimizations here. Do we want to include comments labeling the different optimizations in the source code (with the idea being it'll be easier to back out individual by-hand optimizations as they're implemented in polars)? Or is that not necessary?

"d_date_sk"
)

# store_returns has [6] partitions — at the broadcast limit. Filter it to Q1-Q3 dates

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this (6 partitions, near the broadcast limit) always true, or does that depend on specific configuration settings, GPU size, dataset size, etc?

@Matt711

Matt711 commented May 19, 2026

Copy link
Copy Markdown
Member Author

I haven't run these to confirm that validation still passes, but I'll assume you have ;)

One general question: Your PR description has a nice categorization of the different optimizations here. Do we want to include comments labeling the different optimizations in the source code (with the idea being it'll be easier to back out individual by-hand optimizations as they're implemented in polars)? Or is that not necessary?

That might be a good follow up. We're adding unoptimized queries too. And in a lot of cases it's easy to compare the two. But some of the optimizations are complex enough that's it's worth adding an explanatory comment.

@Matt711

Matt711 commented May 19, 2026

Copy link
Copy Markdown
Member Author

/merge

@rapids-bot
rapids-bot Bot merged commit 691d638 into NVIDIA:release/26.06 May 19, 2026
187 of 197 checks passed
@github-project-automation github-project-automation Bot moved this from In Progress to Done in cuDF Python May 19, 2026
@coderabbitai coderabbitai Bot mentioned this pull request Jul 23, 2026
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cudf-polars Issues specific to cudf-polars improvement Improvement / enhancement to an existing function non-breaking Non-breaking change Performance Performance related issue Python Affects Python cuDF API.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants