Skip to content

Remove repeated elements from IN lists - #10685

Open
robert3005 wants to merge 1 commit into
developfrom
rk/in-list-dedup
Open

robert3005 wants to merge 1 commit into
developfrom
rk/in-list-dedup

Conversation

@robert3005

@robert3005 robert3005 commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor
  • in_list_of removes equal elements after it sorts them. One null element stays, so the SQL semantics do not change.
  • The DataFusion converter converts equal literals once.
  • For a predicate, the converter reads the type and nullability, and does not ask for the return field. DataFusion names the return field by formatting the whole expression. For a large IN list, the formatting costs more than the conversion.
  • contiguous_integer_bounds checks the dtype before it views a scalar as a primitive, because a failed view builds an error.

@codspeed

codspeed Bot commented Oct 21, 2026 •

Copy link
Copy Markdown

Merging this PR will regress 8 benchmarks

4 warnings, 1 note

⚠️ Walltime results may be unreliable

Some benchmarks used the Walltime instrument outside CodSpeed Macro Runners, which can make the results inconsistent.

Learn more about Macro Runners

See affected benchmarks

⚠️ Unable to measure the execution of 1 benchmark

This benchmark measured no execution time, so its result is not comparable and counts as unchanged. This usually happens when the compiler removes the code under test.

Prevent compiler optimizations

See affected benchmarks

⚠️ 23 benchmarks are dominated by system calls

System calls cannot be simulated consistently and are left out of the measure. The reported value understates the real cost. Switch to the Walltime instrument to measure them.

Learn more about system calls

See affected benchmarks

⚠️ Base and head ran on different runner types

Some benchmarks with significant performance changes were compared across different runner types, so the changes might not come from the code. Run base and head on the same runner type, or use CodSpeed Macro Runners for more stable results.

Learn more about Macro Runners

Open the report in CodSpeed to investigate

ℹ️ 40 benchmarks have no flamegraph

The flamegraph wasn't generated: the symbols of the profiling trace could not be resolved, because no information about the language frames was collected.

See affected benchmarks

⚡ 5 improved benchmarks
❌ 8 regressed benchmarks
✅ 2395 untouched benchmarks
⏩ 12 skipped benchmarks1

Warning

Please fix the performance issues or acknowledge them on CodSpeed.

Performance Changes

Mode Benchmark BASE HEAD Efficiency
❌ CPU Simulation test_repeated_scan_scalar_at[int] 239.7 µs 325.3 µs -26.32%
❌ Walltime starts_with_avx2[8, VarBin] 39.9 µs 46.6 µs -14.54%
❌ CPU Simulation test_scan_filter_to_arrow_array[int_float] 3.5 ms 4.1 ms -13.68%
❌ CPU Simulation test_repeated_scan_filter[int_float] 3.4 ms 3.9 ms -12.01%
❌ CPU Simulation random_i128[0.01] 5.2 µs 5.9 µs -11.59%
❌ Walltime threshold_avx2[80] 2.6 µs 2.9 µs -11.34%
❌ CPU Simulation test_repeated_scan_filter[int] 2.4 ms 2.7 ms -10.32%
❌ CPU Simulation test_scan_filter_to_arrow_array[int] 2.5 ms 2.8 ms -10.16%
⚡ CPU Simulation bench_compare_sliced_dict_primitive[(2000, 10000)] 68.9 µs 13.5 µs ×5.1
⚡ CPU Simulation density_sweep_dense_runs[0.001] 61.9 µs 44.3 µs +39.54%
⚡ Walltime random_rotating_avx512[(0.9, 0.9, "self_90pct_mask_90pct")] 9.6 µs 8.3 µs +15.37%
⚡ Walltime starts_with_avx512[64, VarBin] 61.1 µs 53.4 µs +14.3%
⚡ Walltime random_rotating_avx512[(0.5, 0.5, "self_50pct_mask_50pct")] 9.2 µs 8.3 µs +11.78%

Tip

Investigate this regression by commenting @codspeedbot fix this regression on this PR, or directly use the CodSpeed MCP with your agent.


Comparing rk/in-list-dedup (ddb4233) with develop (6f7091d)

Open in CodSpeed

Footnotes

  1. 12 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports. ↩

DataFusion builds the IN list of a hash join filter from the keys of
the build side, which repeat. Each repeat makes the conversion and the
lookup more costly.

- `in_list_of` removes equal elements after it sorts them. One null
  keeps the SQL semantics.
- The DataFusion converter converts equal literals once.
- The converter reads the type and nullability of a predicate, and does
  not ask for its return field. DataFusion names that field by
  formatting the whole expression, which for a large IN list costs more
  than the conversion.
- `contiguous_integer_bounds` checks the dtype before it views a scalar
  as a primitive, because a failed view builds an error.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Robert Kruszewski <github@robertk.io>
@robert3005
robert3005 enabled auto-merge (squash) October 23, 2026 14:50

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

changelog/chore A trivial change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants