Skip to content

perf : experiment roaring bitmap for int32 anti and semi joins#21817

Draft
coderfender wants to merge 16 commits intoapache:mainfrom
coderfender:experiment_roaring_bitmap_for_int32_anti_semi_joins
Draft

perf : experiment roaring bitmap for int32 anti and semi joins#21817
coderfender wants to merge 16 commits intoapache:mainfrom
coderfender:experiment_roaring_bitmap_for_int32_anti_semi_joins

Conversation

@coderfender
Copy link
Copy Markdown
Contributor

@coderfender coderfender commented Apr 23, 2026

Which issue does this PR close?

For RightSemi and RightAnti joins with a single Int32/UInt32 join key and no filter, we can use a Roaring Bitmap instead of a full hash map. This provides:

  1. O(1) membership testing - Roaring bitmaps offer fast contains() lookups
  2. Reduced memory usage - Compressed bitmap vs full hash table
  3. Simpler probe path - Direct filter_record_batch instead of index-based take operations

My local benches showed significant improved with cargo bench FWIW

  • Closes #.

Rationale for this change

What changes are included in this PR?

  1. Added RoaringMap(RoaringBitmap) variant to the Map enum
  2. Build side: Create roaring bitmap from Int32/UInt32 join keys
  3. Probe side: Use filter_record_batch with membership mask
  4. Added roaring_map_created_count metric

Are these changes tested?

Are there any user-facing changes?

@github-actions github-actions Bot added the physical-plan Changes to the physical-plan crate label Apr 23, 2026
@coderfender
Copy link
Copy Markdown
Contributor Author

@Dandandan , could you run benchmarks on this please ?

@github-actions github-actions Bot added the sqllogictest SQL Logic Tests (.slt) label Apr 24, 2026
@coderfender
Copy link
Copy Markdown
Contributor Author

investigating test failures

@coderfender coderfender changed the title Experiment roaring bitmap for int32 anti and semi joins perf : experiment roaring bitmap for int32 anti and semi joins Apr 24, 2026
@2010YOUY01
Copy link
Copy Markdown
Contributor

This is great! I got some questions.

  1. O(1) membership testing - Roaring bitmaps offer fast contains() lookups
  • Wasn't that require first a binary search on container, then probe into the container? It's not obvious to me why roaring bitmap can be faster than hash set.
    I think adding some comment to explain the idea in the code comment would help a lot, for example TLDRs for the idea behind roaring bitmap, and its tradeoff between hashmap.

  • Is there any pathological path for this index? For example certain key distributions, it would become slower or uses more memory.

Additionally, it would be great to show some sql micro benchmarks to demonstrate the improvement, perhaps we can add some target workload to https://github.com/apache/datafusion/blob/main/benchmarks/src/hj.rs

@coderfender
Copy link
Copy Markdown
Contributor Author

coderfender commented Apr 24, 2026

Thank you for your comments . I plan to add benchmarks for hashjoin in a separate pr and rebase this feature once that is merged to main

  1. Re o(1) claim, the roaringbitmap given its size should be CPU cache friendly effectively making 'contains' checks o(1) (although theoretically they are log(n) to fetch containers and log(k) to find element . Given that the number of containers is small and fits in CPU cache I believe it is close to o(1) in most practical cases

  2. True, per my benchmarks (which I plan to add in separate PR) for HJ in semi / anti join cases, the dense checks were as fast as 2x while the sparse data was almost not effected. That said, we could definitely make this more intelligent by probing stats during planning time and only use roaring bitmaps if we could (albeit heuristically) decide there is dense probing required)

@coderfender
Copy link
Copy Markdown
Contributor Author

That said, the benchmarks could totally be proving that current approach is faster and that would be a great learning experience for me :)

@Dandandan
Copy link
Copy Markdown
Contributor

run benchmarks

@adriangbot
Copy link
Copy Markdown

🤖 Benchmark running (GKE) | trigger
Instance: c4a-highmem-16 (12 vCPU / 65 GiB) | Linux bench-c4310610159-1800-692c5 6.12.55+ #1 SMP Sun Feb 1 08:59:41 UTC 2026 aarch64 GNU/Linux

CPU Details (lscpu)
Architecture:                            aarch64
CPU op-mode(s):                          64-bit
Byte Order:                              Little Endian
CPU(s):                                  16
On-line CPU(s) list:                     0-15
Vendor ID:                               ARM
Model name:                              Neoverse-V2
Model:                                   1
Thread(s) per core:                      1
Core(s) per cluster:                     16
Socket(s):                               -
Cluster(s):                              1
Stepping:                                r0p1
BogoMIPS:                                2000.00
Flags:                                   fp asimd evtstrm aes pmull sha1 sha2 crc32 atomics fphp asimdhp cpuid asimdrdm jscvt fcma lrcpc dcpop sha3 sm3 sm4 asimddp sha512 sve asimdfhm dit uscat ilrcpc flagm sb paca pacg dcpodp sve2 sveaes svepmull svebitperm svesha3 svesm4 flagm2 frint svei8mm svebf16 i8mm bf16 dgh rng bti
L1d cache:                               1 MiB (16 instances)
L1i cache:                               1 MiB (16 instances)
L2 cache:                                32 MiB (16 instances)
L3 cache:                                80 MiB (1 instance)
NUMA node(s):                            1
NUMA node0 CPU(s):                       0-15
Vulnerability Gather data sampling:      Not affected
Vulnerability Indirect target selection: Not affected
Vulnerability Itlb multihit:             Not affected
Vulnerability L1tf:                      Not affected
Vulnerability Mds:                       Not affected
Vulnerability Meltdown:                  Not affected
Vulnerability Mmio stale data:           Not affected
Vulnerability Reg file data sampling:    Not affected
Vulnerability Retbleed:                  Not affected
Vulnerability Spec rstack overflow:      Not affected
Vulnerability Spec store bypass:         Mitigation; Speculative Store Bypass disabled via prctl
Vulnerability Spectre v1:                Mitigation; __user pointer sanitization
Vulnerability Spectre v2:                Mitigation; CSV2, BHB
Vulnerability Srbds:                     Not affected
Vulnerability Tsa:                       Not affected
Vulnerability Tsx async abort:           Not affected
Vulnerability Vmscape:                   Not affected

Comparing experiment_roaring_bitmap_for_int32_anti_semi_joins (4fa2df7) to fd093fb (merge-base) diff using: clickbench_partitioned
Results will be posted here when complete


File an issue against this benchmark runner

@adriangbot
Copy link
Copy Markdown

🤖 Benchmark running (GKE) | trigger
Instance: c4a-highmem-16 (12 vCPU / 65 GiB) | Linux bench-c4310610159-1801-xm7fl 6.12.55+ #1 SMP Sun Feb 1 08:59:41 UTC 2026 aarch64 GNU/Linux

CPU Details (lscpu)
Architecture:                            aarch64
CPU op-mode(s):                          64-bit
Byte Order:                              Little Endian
CPU(s):                                  16
On-line CPU(s) list:                     0-15
Vendor ID:                               ARM
Model name:                              Neoverse-V2
Model:                                   1
Thread(s) per core:                      1
Core(s) per cluster:                     16
Socket(s):                               -
Cluster(s):                              1
Stepping:                                r0p1
BogoMIPS:                                2000.00
Flags:                                   fp asimd evtstrm aes pmull sha1 sha2 crc32 atomics fphp asimdhp cpuid asimdrdm jscvt fcma lrcpc dcpop sha3 sm3 sm4 asimddp sha512 sve asimdfhm dit uscat ilrcpc flagm sb paca pacg dcpodp sve2 sveaes svepmull svebitperm svesha3 svesm4 flagm2 frint svei8mm svebf16 i8mm bf16 dgh rng bti
L1d cache:                               1 MiB (16 instances)
L1i cache:                               1 MiB (16 instances)
L2 cache:                                32 MiB (16 instances)
L3 cache:                                80 MiB (1 instance)
NUMA node(s):                            1
NUMA node0 CPU(s):                       0-15
Vulnerability Gather data sampling:      Not affected
Vulnerability Indirect target selection: Not affected
Vulnerability Itlb multihit:             Not affected
Vulnerability L1tf:                      Not affected
Vulnerability Mds:                       Not affected
Vulnerability Meltdown:                  Not affected
Vulnerability Mmio stale data:           Not affected
Vulnerability Reg file data sampling:    Not affected
Vulnerability Retbleed:                  Not affected
Vulnerability Spec rstack overflow:      Not affected
Vulnerability Spec store bypass:         Mitigation; Speculative Store Bypass disabled via prctl
Vulnerability Spectre v1:                Mitigation; __user pointer sanitization
Vulnerability Spectre v2:                Mitigation; CSV2, BHB
Vulnerability Srbds:                     Not affected
Vulnerability Tsa:                       Not affected
Vulnerability Tsx async abort:           Not affected
Vulnerability Vmscape:                   Not affected

Comparing experiment_roaring_bitmap_for_int32_anti_semi_joins (4fa2df7) to fd093fb (merge-base) diff using: tpcds
Results will be posted here when complete


File an issue against this benchmark runner

@adriangbot
Copy link
Copy Markdown

🤖 Benchmark running (GKE) | trigger
Instance: c4a-highmem-16 (12 vCPU / 65 GiB) | Linux bench-c4310610159-1802-g5sjb 6.12.55+ #1 SMP Sun Feb 1 08:59:41 UTC 2026 aarch64 GNU/Linux

CPU Details (lscpu)
Architecture:                            aarch64
CPU op-mode(s):                          64-bit
Byte Order:                              Little Endian
CPU(s):                                  16
On-line CPU(s) list:                     0-15
Vendor ID:                               ARM
Model name:                              Neoverse-V2
Model:                                   1
Thread(s) per core:                      1
Core(s) per cluster:                     16
Socket(s):                               -
Cluster(s):                              1
Stepping:                                r0p1
BogoMIPS:                                2000.00
Flags:                                   fp asimd evtstrm aes pmull sha1 sha2 crc32 atomics fphp asimdhp cpuid asimdrdm jscvt fcma lrcpc dcpop sha3 sm3 sm4 asimddp sha512 sve asimdfhm dit uscat ilrcpc flagm sb paca pacg dcpodp sve2 sveaes svepmull svebitperm svesha3 svesm4 flagm2 frint svei8mm svebf16 i8mm bf16 dgh rng bti
L1d cache:                               1 MiB (16 instances)
L1i cache:                               1 MiB (16 instances)
L2 cache:                                32 MiB (16 instances)
L3 cache:                                80 MiB (1 instance)
NUMA node(s):                            1
NUMA node0 CPU(s):                       0-15
Vulnerability Gather data sampling:      Not affected
Vulnerability Indirect target selection: Not affected
Vulnerability Itlb multihit:             Not affected
Vulnerability L1tf:                      Not affected
Vulnerability Mds:                       Not affected
Vulnerability Meltdown:                  Not affected
Vulnerability Mmio stale data:           Not affected
Vulnerability Reg file data sampling:    Not affected
Vulnerability Retbleed:                  Not affected
Vulnerability Spec rstack overflow:      Not affected
Vulnerability Spec store bypass:         Mitigation; Speculative Store Bypass disabled via prctl
Vulnerability Spectre v1:                Mitigation; __user pointer sanitization
Vulnerability Spectre v2:                Mitigation; CSV2, BHB
Vulnerability Srbds:                     Not affected
Vulnerability Tsa:                       Not affected
Vulnerability Tsx async abort:           Not affected
Vulnerability Vmscape:                   Not affected

Comparing experiment_roaring_bitmap_for_int32_anti_semi_joins (4fa2df7) to fd093fb (merge-base) diff using: tpch
Results will be posted here when complete


File an issue against this benchmark runner

@coderfender
Copy link
Copy Markdown
Contributor Author

The queries are failing in the partitioned hash mode . I reckon we could enable support with partitioned hash mode given that the hashes (in this case bitmaps) are co located ?

@adriangbot
Copy link
Copy Markdown

🤖 Benchmark completed (GKE) | trigger

Instance: c4a-highmem-16 (12 vCPU / 65 GiB)

CPU Details (lscpu)
Architecture:                            aarch64
CPU op-mode(s):                          64-bit
Byte Order:                              Little Endian
CPU(s):                                  16
On-line CPU(s) list:                     0-15
Vendor ID:                               ARM
Model name:                              Neoverse-V2
Model:                                   1
Thread(s) per core:                      1
Core(s) per cluster:                     16
Socket(s):                               -
Cluster(s):                              1
Stepping:                                r0p1
BogoMIPS:                                2000.00
Flags:                                   fp asimd evtstrm aes pmull sha1 sha2 crc32 atomics fphp asimdhp cpuid asimdrdm jscvt fcma lrcpc dcpop sha3 sm3 sm4 asimddp sha512 sve asimdfhm dit uscat ilrcpc flagm sb paca pacg dcpodp sve2 sveaes svepmull svebitperm svesha3 svesm4 flagm2 frint svei8mm svebf16 i8mm bf16 dgh rng bti
L1d cache:                               1 MiB (16 instances)
L1i cache:                               1 MiB (16 instances)
L2 cache:                                32 MiB (16 instances)
L3 cache:                                80 MiB (1 instance)
NUMA node(s):                            1
NUMA node0 CPU(s):                       0-15
Vulnerability Gather data sampling:      Not affected
Vulnerability Indirect target selection: Not affected
Vulnerability Itlb multihit:             Not affected
Vulnerability L1tf:                      Not affected
Vulnerability Mds:                       Not affected
Vulnerability Meltdown:                  Not affected
Vulnerability Mmio stale data:           Not affected
Vulnerability Reg file data sampling:    Not affected
Vulnerability Retbleed:                  Not affected
Vulnerability Spec rstack overflow:      Not affected
Vulnerability Spec store bypass:         Mitigation; Speculative Store Bypass disabled via prctl
Vulnerability Spectre v1:                Mitigation; __user pointer sanitization
Vulnerability Spectre v2:                Mitigation; CSV2, BHB
Vulnerability Srbds:                     Not affected
Vulnerability Tsa:                       Not affected
Vulnerability Tsx async abort:           Not affected
Vulnerability Vmscape:                   Not affected
Details

Comparing HEAD and experiment_roaring_bitmap_for_int32_anti_semi_joins
--------------------
Benchmark tpch_sf1.json
--------------------
┏━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━┓
┃ Query     ┃                           HEAD ┃ experiment_roaring_bitmap_for_int32_anti_semi_joins ┃       Change ┃
┡━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━┩
│ QQuery 1  │ 39.77 / 40.98 ±1.89 / 44.75 ms │                      40.11 / 40.83 ±1.30 / 43.42 ms │    no change │
│ QQuery 2  │ 20.66 / 21.07 ±0.27 / 21.41 ms │                      21.01 / 21.12 ±0.15 / 21.41 ms │    no change │
│ QQuery 3  │ 37.68 / 40.57 ±1.53 / 42.25 ms │                      39.13 / 40.49 ±0.73 / 41.03 ms │    no change │
│ QQuery 4  │ 18.04 / 18.75 ±0.74 / 20.12 ms │                      18.30 / 18.98 ±0.59 / 19.92 ms │    no change │
│ QQuery 5  │ 46.41 / 48.52 ±1.68 / 50.68 ms │                      47.68 / 51.49 ±2.74 / 54.88 ms │ 1.06x slower │
│ QQuery 6  │ 17.32 / 17.86 ±0.86 / 19.57 ms │                      17.29 / 17.41 ±0.09 / 17.54 ms │    no change │
│ QQuery 7  │ 53.53 / 55.77 ±1.74 / 58.14 ms │                      55.03 / 55.61 ±0.47 / 56.40 ms │    no change │
│ QQuery 8  │ 47.60 / 48.16 ±0.61 / 49.28 ms │                      48.08 / 48.27 ±0.14 / 48.51 ms │    no change │
│ QQuery 9  │ 52.57 / 54.05 ±1.16 / 56.11 ms │                      53.26 / 54.12 ±0.90 / 55.85 ms │    no change │
│ QQuery 10 │ 64.26 / 65.55 ±1.82 / 69.16 ms │                      64.64 / 65.03 ±0.28 / 65.38 ms │    no change │
│ QQuery 11 │ 13.98 / 14.17 ±0.19 / 14.54 ms │                      14.15 / 14.60 ±0.46 / 15.48 ms │    no change │
│ QQuery 12 │ 27.02 / 27.34 ±0.28 / 27.85 ms │                      27.44 / 27.64 ±0.23 / 28.05 ms │    no change │
│ QQuery 13 │ 36.98 / 37.57 ±0.50 / 38.42 ms │                      36.91 / 37.81 ±0.83 / 38.88 ms │    no change │
│ QQuery 14 │ 27.48 / 28.00 ±0.72 / 29.41 ms │                      27.87 / 28.02 ±0.09 / 28.12 ms │    no change │
│ QQuery 15 │ 33.23 / 34.88 ±2.23 / 39.14 ms │                      33.40 / 33.86 ±0.34 / 34.40 ms │    no change │
│ QQuery 16 │ 15.32 / 15.51 ±0.14 / 15.72 ms │                      15.38 / 15.47 ±0.09 / 15.63 ms │    no change │
│ QQuery 17 │ 77.45 / 79.21 ±2.08 / 83.29 ms │                      77.53 / 78.51 ±0.50 / 78.89 ms │    no change │
│ QQuery 18 │ 74.75 / 75.86 ±0.89 / 77.30 ms │                      76.03 / 77.00 ±1.14 / 79.24 ms │    no change │
│ QQuery 19 │ 37.18 / 37.35 ±0.19 / 37.71 ms │                      37.29 / 38.04 ±0.50 / 38.70 ms │    no change │
│ QQuery 20 │ 39.40 / 40.10 ±0.74 / 41.54 ms │                      39.97 / 41.32 ±2.11 / 45.47 ms │    no change │
│ QQuery 21 │ 62.59 / 63.23 ±0.47 / 63.79 ms │                      63.18 / 64.41 ±0.73 / 65.35 ms │    no change │
│ QQuery 22 │ 16.63 / 16.77 ±0.13 / 17.01 ms │                      16.63 / 17.10 ±0.54 / 17.84 ms │    no change │
└───────────┴────────────────────────────────┴─────────────────────────────────────────────────────┴──────────────┘
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━┓
┃ Benchmark Summary                                                  ┃          ┃
┡━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━┩
│ Total Time (HEAD)                                                  │ 881.25ms │
│ Total Time (experiment_roaring_bitmap_for_int32_anti_semi_joins)   │ 887.15ms │
│ Average Time (HEAD)                                                │  40.06ms │
│ Average Time (experiment_roaring_bitmap_for_int32_anti_semi_joins) │  40.32ms │
│ Queries Faster                                                     │        0 │
│ Queries Slower                                                     │        1 │
│ Queries with No Change                                             │       21 │
│ Queries with Failure                                               │        0 │
└────────────────────────────────────────────────────────────────────┴──────────┘

Resource Usage

tpch — base (merge-base)

Metric Value
Wall time 5.0s
Peak memory 5.5 GiB
Avg memory 4.8 GiB
CPU user 33.4s
CPU sys 2.3s
Peak spill 0 B

tpch — branch

Metric Value
Wall time 5.0s
Peak memory 5.4 GiB
Avg memory 4.8 GiB
CPU user 33.7s
CPU sys 2.3s
Peak spill 0 B

File an issue against this benchmark runner

@adriangbot
Copy link
Copy Markdown

🤖 Benchmark completed (GKE) | trigger

Instance: c4a-highmem-16 (12 vCPU / 65 GiB)

CPU Details (lscpu)
Architecture:                            aarch64
CPU op-mode(s):                          64-bit
Byte Order:                              Little Endian
CPU(s):                                  16
On-line CPU(s) list:                     0-15
Vendor ID:                               ARM
Model name:                              Neoverse-V2
Model:                                   1
Thread(s) per core:                      1
Core(s) per cluster:                     16
Socket(s):                               -
Cluster(s):                              1
Stepping:                                r0p1
BogoMIPS:                                2000.00
Flags:                                   fp asimd evtstrm aes pmull sha1 sha2 crc32 atomics fphp asimdhp cpuid asimdrdm jscvt fcma lrcpc dcpop sha3 sm3 sm4 asimddp sha512 sve asimdfhm dit uscat ilrcpc flagm sb paca pacg dcpodp sve2 sveaes svepmull svebitperm svesha3 svesm4 flagm2 frint svei8mm svebf16 i8mm bf16 dgh rng bti
L1d cache:                               1 MiB (16 instances)
L1i cache:                               1 MiB (16 instances)
L2 cache:                                32 MiB (16 instances)
L3 cache:                                80 MiB (1 instance)
NUMA node(s):                            1
NUMA node0 CPU(s):                       0-15
Vulnerability Gather data sampling:      Not affected
Vulnerability Indirect target selection: Not affected
Vulnerability Itlb multihit:             Not affected
Vulnerability L1tf:                      Not affected
Vulnerability Mds:                       Not affected
Vulnerability Meltdown:                  Not affected
Vulnerability Mmio stale data:           Not affected
Vulnerability Reg file data sampling:    Not affected
Vulnerability Retbleed:                  Not affected
Vulnerability Spec rstack overflow:      Not affected
Vulnerability Spec store bypass:         Mitigation; Speculative Store Bypass disabled via prctl
Vulnerability Spectre v1:                Mitigation; __user pointer sanitization
Vulnerability Spectre v2:                Mitigation; CSV2, BHB
Vulnerability Srbds:                     Not affected
Vulnerability Tsa:                       Not affected
Vulnerability Tsx async abort:           Not affected
Vulnerability Vmscape:                   Not affected
Details

Comparing HEAD and experiment_roaring_bitmap_for_int32_anti_semi_joins
--------------------
Benchmark tpcds_sf1.json
--------------------
┏━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━┓
┃ Query     ┃                                     HEAD ┃ experiment_roaring_bitmap_for_int32_anti_semi_joins ┃        Change ┃
┡━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━┩
│ QQuery 1  │              6.73 / 7.21 ±0.84 / 8.88 ms │                         6.84 / 7.31 ±0.83 / 8.97 ms │     no change │
│ QQuery 2  │        144.57 / 145.15 ±0.42 / 145.73 ms │                   143.74 / 144.26 ±0.36 / 144.81 ms │     no change │
│ QQuery 3  │        113.44 / 114.80 ±0.94 / 116.34 ms │                   112.38 / 113.25 ±0.64 / 114.00 ms │     no change │
│ QQuery 4  │     1279.03 / 1287.00 ±7.75 / 1300.03 ms │               1268.08 / 1281.81 ±10.35 / 1295.47 ms │     no change │
│ QQuery 5  │        173.92 / 175.02 ±0.90 / 176.39 ms │                   172.25 / 173.09 ±0.76 / 174.37 ms │     no change │
│ QQuery 6  │       815.28 / 843.48 ±18.74 / 868.39 ms │                  805.58 / 856.45 ±47.54 / 936.62 ms │     no change │
│ QQuery 7  │        333.13 / 335.94 ±2.06 / 338.20 ms │                   332.57 / 334.83 ±2.09 / 338.14 ms │     no change │
│ QQuery 8  │        113.05 / 113.96 ±1.28 / 116.46 ms │                   112.19 / 112.54 ±0.31 / 113.05 ms │     no change │
│ QQuery 9  │        100.22 / 103.24 ±2.74 / 106.70 ms │                   100.66 / 103.85 ±2.60 / 106.39 ms │     no change │
│ QQuery 10 │        101.50 / 102.75 ±2.32 / 107.39 ms │                   101.98 / 102.56 ±0.74 / 104.00 ms │     no change │
│ QQuery 11 │        882.86 / 897.46 ±8.36 / 905.66 ms │                   874.12 / 884.91 ±6.86 / 892.80 ms │     no change │
│ QQuery 12 │           42.79 / 43.41 ±0.58 / 44.35 ms │                      42.91 / 43.35 ±0.33 / 43.85 ms │     no change │
│ QQuery 13 │        388.52 / 389.83 ±0.80 / 390.90 ms │                   386.65 / 389.11 ±1.62 / 391.24 ms │     no change │
│ QQuery 14 │        980.97 / 985.54 ±5.36 / 995.15 ms │                   973.25 / 975.89 ±2.20 / 978.65 ms │     no change │
│ QQuery 15 │           14.75 / 14.97 ±0.33 / 15.62 ms │                      14.45 / 14.80 ±0.30 / 15.32 ms │     no change │
│ QQuery 16 │              7.33 / 7.51 ±0.23 / 7.97 ms │                         7.29 / 7.40 ±0.13 / 7.64 ms │     no change │
│ QQuery 17 │        222.64 / 225.17 ±1.27 / 225.96 ms │                   220.74 / 221.29 ±0.65 / 222.52 ms │     no change │
│ QQuery 18 │        126.59 / 127.63 ±1.22 / 129.85 ms │                   125.93 / 126.66 ±1.07 / 128.78 ms │     no change │
│ QQuery 19 │        154.95 / 156.33 ±0.94 / 157.36 ms │                   152.87 / 154.30 ±1.14 / 156.04 ms │     no change │
│ QQuery 20 │           13.01 / 13.10 ±0.13 / 13.35 ms │                      12.88 / 13.13 ±0.19 / 13.43 ms │     no change │
│ QQuery 21 │           19.29 / 19.60 ±0.17 / 19.77 ms │                      18.62 / 18.80 ±0.19 / 19.14 ms │     no change │
│ QQuery 22 │        479.28 / 481.78 ±2.88 / 486.99 ms │                   469.76 / 473.80 ±2.79 / 476.96 ms │     no change │
│ QQuery 23 │       814.64 / 830.98 ±12.15 / 845.55 ms │                   810.35 / 816.84 ±3.79 / 821.97 ms │     no change │
│ QQuery 24 │        369.93 / 375.45 ±4.10 / 380.44 ms │                   370.14 / 372.43 ±2.54 / 377.38 ms │     no change │
│ QQuery 25 │        330.59 / 333.41 ±1.70 / 335.24 ms │                   330.99 / 332.39 ±1.16 / 334.23 ms │     no change │
│ QQuery 26 │           76.74 / 77.18 ±0.44 / 78.02 ms │                      77.31 / 77.50 ±0.13 / 77.67 ms │     no change │
│ QQuery 27 │              6.71 / 6.84 ±0.18 / 7.20 ms │                         6.98 / 7.11 ±0.17 / 7.43 ms │     no change │
│ QQuery 28 │        147.76 / 149.07 ±0.76 / 149.82 ms │                   147.45 / 148.27 ±0.58 / 149.00 ms │     no change │
│ QQuery 29 │        271.58 / 274.01 ±3.55 / 280.91 ms │                   269.16 / 272.96 ±3.11 / 278.45 ms │     no change │
│ QQuery 30 │           41.15 / 41.49 ±0.39 / 42.25 ms │                      41.33 / 42.18 ±0.82 / 43.75 ms │     no change │
│ QQuery 31 │        164.73 / 165.66 ±1.49 / 168.62 ms │                   164.29 / 165.78 ±1.54 / 168.65 ms │     no change │
│ QQuery 32 │           13.22 / 13.34 ±0.14 / 13.58 ms │                      13.36 / 13.45 ±0.14 / 13.72 ms │     no change │
│ QQuery 33 │        137.20 / 139.30 ±1.23 / 140.39 ms │                   138.75 / 140.40 ±1.48 / 143.03 ms │     no change │
│ QQuery 34 │              6.77 / 6.91 ±0.17 / 7.21 ms │                         6.81 / 7.02 ±0.23 / 7.45 ms │     no change │
│ QQuery 35 │        100.72 / 101.84 ±1.64 / 105.03 ms │                    99.72 / 100.61 ±1.10 / 102.72 ms │     no change │
│ QQuery 36 │              6.38 / 6.74 ±0.21 / 6.91 ms │                         6.54 / 6.70 ±0.13 / 6.91 ms │     no change │
│ QQuery 37 │              8.09 / 8.19 ±0.07 / 8.28 ms │                         8.10 / 8.18 ±0.05 / 8.23 ms │     no change │
│ QQuery 38 │           84.61 / 85.31 ±0.56 / 86.16 ms │                      85.23 / 87.05 ±1.47 / 89.31 ms │     no change │
│ QQuery 39 │        115.99 / 118.92 ±3.88 / 126.59 ms │                   115.36 / 118.65 ±3.87 / 125.94 ms │     no change │
│ QQuery 40 │        101.78 / 103.89 ±2.58 / 108.90 ms │                   103.44 / 106.67 ±2.75 / 110.87 ms │     no change │
│ QQuery 41 │           14.09 / 15.09 ±1.68 / 18.43 ms │                      13.99 / 14.19 ±0.25 / 14.69 ms │ +1.06x faster │
│ QQuery 42 │        107.95 / 109.08 ±0.97 / 110.55 ms │                   106.10 / 106.89 ±0.71 / 107.84 ms │     no change │
│ QQuery 43 │              5.57 / 5.67 ±0.10 / 5.86 ms │                         5.64 / 5.79 ±0.16 / 6.10 ms │     no change │
│ QQuery 44 │           11.21 / 11.41 ±0.13 / 11.61 ms │                      11.64 / 13.15 ±2.82 / 18.80 ms │  1.15x slower │
│ QQuery 45 │           48.43 / 48.88 ±0.25 / 49.13 ms │                      48.10 / 48.63 ±0.36 / 49.16 ms │     no change │
│ QQuery 46 │              8.24 / 8.45 ±0.22 / 8.86 ms │                         8.43 / 8.55 ±0.21 / 8.97 ms │     no change │
│ QQuery 47 │        679.90 / 686.72 ±4.10 / 690.97 ms │                   682.46 / 685.22 ±3.07 / 690.99 ms │     no change │
│ QQuery 48 │        274.39 / 276.40 ±1.39 / 278.41 ms │                   273.06 / 275.10 ±1.18 / 276.56 ms │     no change │
│ QQuery 49 │        248.91 / 250.25 ±1.05 / 251.26 ms │                   249.37 / 250.63 ±1.71 / 253.99 ms │     no change │
│ QQuery 50 │        198.87 / 204.92 ±4.48 / 211.98 ms │                   198.38 / 205.64 ±4.71 / 212.47 ms │     no change │
│ QQuery 51 │        175.66 / 176.91 ±0.78 / 177.81 ms │                   175.84 / 178.71 ±1.78 / 181.22 ms │     no change │
│ QQuery 52 │        106.99 / 108.76 ±1.69 / 111.91 ms │                   106.04 / 108.36 ±1.99 / 111.86 ms │     no change │
│ QQuery 53 │        102.11 / 102.68 ±0.61 / 103.74 ms │                   100.59 / 101.43 ±0.55 / 102.08 ms │     no change │
│ QQuery 54 │        144.08 / 145.64 ±1.50 / 148.53 ms │                   144.38 / 146.29 ±1.93 / 149.81 ms │     no change │
│ QQuery 55 │        106.13 / 106.65 ±0.67 / 107.93 ms │                   104.66 / 105.53 ±0.47 / 106.02 ms │     no change │
│ QQuery 56 │        139.52 / 140.04 ±0.40 / 140.70 ms │                   139.32 / 140.57 ±1.09 / 142.61 ms │     no change │
│ QQuery 57 │        162.15 / 164.30 ±2.09 / 168.18 ms │                   165.23 / 166.41 ±1.53 / 169.24 ms │     no change │
│ QQuery 58 │        306.26 / 309.08 ±2.03 / 311.75 ms │                   307.74 / 309.72 ±1.32 / 311.42 ms │     no change │
│ QQuery 59 │        192.42 / 195.36 ±1.73 / 196.87 ms │                   192.60 / 193.03 ±0.35 / 193.51 ms │     no change │
│ QQuery 60 │        139.54 / 140.63 ±0.72 / 141.45 ms │                   140.28 / 141.69 ±1.55 / 144.43 ms │     no change │
│ QQuery 61 │           13.21 / 14.15 ±1.57 / 17.27 ms │                      13.44 / 13.58 ±0.16 / 13.87 ms │     no change │
│ QQuery 62 │        857.70 / 863.19 ±6.31 / 874.55 ms │                   866.72 / 869.87 ±2.52 / 873.14 ms │     no change │
│ QQuery 63 │        101.71 / 102.22 ±0.37 / 102.80 ms │                   100.67 / 101.95 ±1.26 / 104.38 ms │     no change │
│ QQuery 64 │        657.46 / 660.12 ±3.17 / 665.52 ms │                   659.77 / 665.36 ±5.67 / 673.82 ms │     no change │
│ QQuery 65 │        241.66 / 244.39 ±3.43 / 251.05 ms │                   243.52 / 246.59 ±3.48 / 252.36 ms │     no change │
│ QQuery 66 │        209.93 / 221.53 ±9.36 / 236.18 ms │                  212.09 / 225.55 ±13.47 / 241.93 ms │     no change │
│ QQuery 67 │        290.54 / 297.73 ±7.05 / 308.14 ms │                   290.42 / 297.66 ±7.53 / 308.03 ms │     no change │
│ QQuery 68 │              8.48 / 8.67 ±0.18 / 9.00 ms │                         8.57 / 8.78 ±0.20 / 9.11 ms │     no change │
│ QQuery 69 │         97.26 / 100.84 ±4.33 / 108.48 ms │                     97.11 / 99.50 ±3.44 / 106.31 ms │     no change │
│ QQuery 70 │        310.74 / 320.50 ±6.48 / 326.35 ms │                   308.87 / 320.97 ±9.11 / 334.54 ms │     no change │
│ QQuery 71 │        132.40 / 135.31 ±2.46 / 138.39 ms │                   131.44 / 133.52 ±2.35 / 138.08 ms │     no change │
│ QQuery 72 │        579.35 / 589.89 ±5.51 / 595.39 ms │                   578.82 / 587.58 ±8.67 / 599.72 ms │     no change │
│ QQuery 73 │              6.51 / 6.65 ±0.19 / 7.02 ms │                         6.54 / 6.70 ±0.20 / 7.09 ms │     no change │
│ QQuery 74 │        547.90 / 557.88 ±5.91 / 563.09 ms │                   548.13 / 552.42 ±3.64 / 557.49 ms │     no change │
│ QQuery 75 │        266.70 / 268.03 ±1.32 / 270.33 ms │                   266.05 / 267.70 ±2.97 / 273.64 ms │     no change │
│ QQuery 76 │        130.08 / 131.05 ±1.11 / 133.14 ms │                   129.94 / 130.98 ±0.77 / 132.17 ms │     no change │
│ QQuery 77 │        185.58 / 186.62 ±1.02 / 188.43 ms │                   185.56 / 186.72 ±0.78 / 187.65 ms │     no change │
│ QQuery 78 │        326.10 / 328.87 ±1.96 / 331.42 ms │                   326.45 / 327.41 ±0.70 / 328.59 ms │     no change │
│ QQuery 79 │        226.56 / 229.05 ±1.88 / 231.36 ms │                   226.28 / 229.05 ±2.66 / 234.14 ms │     no change │
│ QQuery 80 │        316.19 / 318.09 ±0.99 / 318.84 ms │                   316.27 / 318.66 ±1.65 / 320.98 ms │     no change │
│ QQuery 81 │           25.41 / 25.51 ±0.08 / 25.60 ms │                      26.05 / 26.43 ±0.29 / 26.81 ms │     no change │
│ QQuery 82 │           38.99 / 39.17 ±0.23 / 39.55 ms │                      38.77 / 39.04 ±0.18 / 39.26 ms │     no change │
│ QQuery 83 │           36.67 / 37.56 ±1.42 / 40.39 ms │                      36.85 / 37.11 ±0.21 / 37.35 ms │     no change │
│ QQuery 84 │           45.78 / 46.02 ±0.18 / 46.25 ms │                      46.34 / 47.38 ±1.34 / 50.02 ms │     no change │
│ QQuery 85 │        140.34 / 140.98 ±0.45 / 141.67 ms │                   139.65 / 140.78 ±0.95 / 142.17 ms │     no change │
│ QQuery 86 │           37.08 / 37.54 ±0.27 / 37.84 ms │                      37.29 / 37.81 ±0.53 / 38.80 ms │     no change │
│ QQuery 87 │              3.35 / 3.47 ±0.15 / 3.77 ms │                         3.47 / 3.57 ±0.14 / 3.84 ms │     no change │
│ QQuery 88 │          97.56 / 99.62 ±1.95 / 103.22 ms │                     97.52 / 98.99 ±1.18 / 101.14 ms │     no change │
│ QQuery 89 │        115.17 / 116.33 ±1.16 / 118.54 ms │                   115.38 / 117.05 ±3.07 / 123.20 ms │     no change │
│ QQuery 90 │           21.57 / 22.16 ±0.56 / 23.18 ms │                      21.95 / 22.64 ±0.51 / 23.35 ms │     no change │
│ QQuery 91 │           57.50 / 58.12 ±0.45 / 58.77 ms │                      58.42 / 58.78 ±0.58 / 59.94 ms │     no change │
│ QQuery 92 │           56.10 / 56.63 ±0.57 / 57.67 ms │                      55.90 / 56.43 ±0.31 / 56.86 ms │     no change │
│ QQuery 93 │        180.79 / 181.56 ±0.94 / 183.26 ms │                   179.30 / 181.97 ±2.69 / 186.84 ms │     no change │
│ QQuery 94 │           59.85 / 60.67 ±0.72 / 61.84 ms │                      60.58 / 61.19 ±0.49 / 62.03 ms │     no change │
│ QQuery 95 │        124.91 / 126.04 ±0.86 / 127.46 ms │                   124.34 / 124.97 ±0.79 / 126.43 ms │     no change │
│ QQuery 96 │           67.55 / 68.99 ±1.07 / 70.43 ms │                      67.04 / 68.63 ±1.37 / 70.67 ms │     no change │
│ QQuery 97 │        116.05 / 116.82 ±0.59 / 117.59 ms │                   116.77 / 118.56 ±1.87 / 122.09 ms │     no change │
│ QQuery 98 │        147.60 / 148.95 ±1.09 / 150.84 ms │                   148.63 / 150.03 ±1.19 / 151.64 ms │     no change │
│ QQuery 99 │ 10719.81 / 10827.61 ±76.91 / 10960.26 ms │            10722.06 / 10858.30 ±93.19 / 10969.05 ms │     no change │
└───────────┴──────────────────────────────────────────┴─────────────────────────────────────────────────────┴───────────────┘
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━┓
┃ Benchmark Summary                                                  ┃            ┃
┡━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━┩
│ Total Time (HEAD)                                                  │ 30434.82ms │
│ Total Time (experiment_roaring_bitmap_for_int32_anti_semi_joins)   │ 30423.34ms │
│ Average Time (HEAD)                                                │   307.42ms │
│ Average Time (experiment_roaring_bitmap_for_int32_anti_semi_joins) │   307.31ms │
│ Queries Faster                                                     │          1 │
│ Queries Slower                                                     │          1 │
│ Queries with No Change                                             │         97 │
│ Queries with Failure                                               │          0 │
└────────────────────────────────────────────────────────────────────┴────────────┘

Resource Usage

tpcds — base (merge-base)

Metric Value
Wall time 155.0s
Peak memory 6.6 GiB
Avg memory 5.6 GiB
CPU user 254.2s
CPU sys 8.0s
Peak spill 0 B

tpcds — branch

Metric Value
Wall time 155.0s
Peak memory 6.3 GiB
Avg memory 5.6 GiB
CPU user 253.6s
CPU sys 8.2s
Peak spill 0 B

File an issue against this benchmark runner

@adriangbot
Copy link
Copy Markdown

🤖 Benchmark completed (GKE) | trigger

Instance: c4a-highmem-16 (12 vCPU / 65 GiB)

CPU Details (lscpu)
Architecture:                            aarch64
CPU op-mode(s):                          64-bit
Byte Order:                              Little Endian
CPU(s):                                  16
On-line CPU(s) list:                     0-15
Vendor ID:                               ARM
Model name:                              Neoverse-V2
Model:                                   1
Thread(s) per core:                      1
Core(s) per cluster:                     16
Socket(s):                               -
Cluster(s):                              1
Stepping:                                r0p1
BogoMIPS:                                2000.00
Flags:                                   fp asimd evtstrm aes pmull sha1 sha2 crc32 atomics fphp asimdhp cpuid asimdrdm jscvt fcma lrcpc dcpop sha3 sm3 sm4 asimddp sha512 sve asimdfhm dit uscat ilrcpc flagm sb paca pacg dcpodp sve2 sveaes svepmull svebitperm svesha3 svesm4 flagm2 frint svei8mm svebf16 i8mm bf16 dgh rng bti
L1d cache:                               1 MiB (16 instances)
L1i cache:                               1 MiB (16 instances)
L2 cache:                                32 MiB (16 instances)
L3 cache:                                80 MiB (1 instance)
NUMA node(s):                            1
NUMA node0 CPU(s):                       0-15
Vulnerability Gather data sampling:      Not affected
Vulnerability Indirect target selection: Not affected
Vulnerability Itlb multihit:             Not affected
Vulnerability L1tf:                      Not affected
Vulnerability Mds:                       Not affected
Vulnerability Meltdown:                  Not affected
Vulnerability Mmio stale data:           Not affected
Vulnerability Reg file data sampling:    Not affected
Vulnerability Retbleed:                  Not affected
Vulnerability Spec rstack overflow:      Not affected
Vulnerability Spec store bypass:         Mitigation; Speculative Store Bypass disabled via prctl
Vulnerability Spectre v1:                Mitigation; __user pointer sanitization
Vulnerability Spectre v2:                Mitigation; CSV2, BHB
Vulnerability Srbds:                     Not affected
Vulnerability Tsa:                       Not affected
Vulnerability Tsx async abort:           Not affected
Vulnerability Vmscape:                   Not affected
Details

Comparing HEAD and experiment_roaring_bitmap_for_int32_anti_semi_joins
--------------------
Benchmark clickbench_partitioned.json
--------------------
┏━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━┓
┃ Query     ┃                                   HEAD ┃ experiment_roaring_bitmap_for_int32_anti_semi_joins ┃        Change ┃
┡━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━┩
│ QQuery 0  │           1.18 / 4.56 ±6.69 / 17.94 ms │                        1.32 / 4.94 ±6.98 / 18.89 ms │  1.08x slower │
│ QQuery 1  │         13.17 / 13.56 ±0.34 / 14.17 ms │                      12.92 / 13.29 ±0.19 / 13.48 ms │     no change │
│ QQuery 2  │         37.75 / 38.96 ±1.03 / 40.56 ms │                      38.12 / 38.34 ±0.26 / 38.79 ms │     no change │
│ QQuery 3  │         31.79 / 34.44 ±2.06 / 37.50 ms │                      33.10 / 33.66 ±0.43 / 34.23 ms │     no change │
│ QQuery 4  │      249.16 / 251.25 ±1.24 / 252.71 ms │                   257.42 / 262.96 ±4.57 / 271.29 ms │     no change │
│ QQuery 5  │      285.25 / 290.45 ±7.82 / 305.68 ms │                   302.01 / 307.55 ±5.82 / 318.62 ms │  1.06x slower │
│ QQuery 6  │            7.21 / 7.86 ±0.49 / 8.56 ms │                         7.81 / 8.35 ±0.52 / 9.07 ms │  1.06x slower │
│ QQuery 7  │         15.24 / 15.57 ±0.24 / 16.00 ms │                      14.86 / 15.06 ±0.19 / 15.28 ms │     no change │
│ QQuery 8  │     330.04 / 349.81 ±25.27 / 393.53 ms │                   387.60 / 403.08 ±8.92 / 413.44 ms │  1.15x slower │
│ QQuery 9  │      448.33 / 458.53 ±8.87 / 471.19 ms │                   548.57 / 561.30 ±7.72 / 568.30 ms │  1.22x slower │
│ QQuery 10 │         75.18 / 77.41 ±2.19 / 81.53 ms │                      79.86 / 81.10 ±0.89 / 82.63 ms │     no change │
│ QQuery 11 │         87.26 / 88.01 ±0.56 / 88.95 ms │                      91.85 / 94.78 ±1.71 / 96.49 ms │  1.08x slower │
│ QQuery 12 │      278.32 / 284.11 ±4.71 / 289.38 ms │                  306.00 / 324.23 ±12.73 / 342.70 ms │  1.14x slower │
│ QQuery 13 │     401.61 / 420.32 ±14.50 / 443.31 ms │                  427.94 / 445.31 ±12.99 / 462.76 ms │  1.06x slower │
│ QQuery 14 │      292.49 / 294.79 ±2.20 / 298.80 ms │                   306.09 / 317.04 ±7.69 / 329.71 ms │  1.08x slower │
│ QQuery 15 │      284.71 / 289.12 ±2.86 / 292.38 ms │                   310.60 / 321.58 ±7.39 / 332.44 ms │  1.11x slower │
│ QQuery 16 │      629.83 / 636.55 ±7.48 / 650.52 ms │                   663.46 / 668.92 ±2.95 / 671.63 ms │  1.05x slower │
│ QQuery 17 │      624.52 / 630.96 ±4.23 / 637.53 ms │                   674.26 / 683.91 ±5.41 / 689.76 ms │  1.08x slower │
│ QQuery 18 │   1261.83 / 1276.29 ±8.35 / 1285.25 ms │               1381.97 / 1427.54 ±37.81 / 1489.73 ms │  1.12x slower │
│ QQuery 19 │         29.21 / 29.62 ±0.45 / 30.49 ms │                      29.98 / 31.06 ±1.78 / 34.61 ms │     no change │
│ QQuery 20 │     521.86 / 535.89 ±11.22 / 555.65 ms │                   530.82 / 537.13 ±9.25 / 555.54 ms │     no change │
│ QQuery 21 │      596.97 / 603.30 ±5.17 / 611.87 ms │                   609.72 / 612.34 ±3.40 / 618.92 ms │     no change │
│ QQuery 22 │   1060.32 / 1065.47 ±4.84 / 1073.80 ms │               1093.00 / 1106.42 ±12.62 / 1130.28 ms │     no change │
│ QQuery 23 │ 3352.33 / 3507.43 ±115.36 / 3705.99 ms │               3413.45 / 3455.76 ±23.24 / 3482.48 ms │     no change │
│ QQuery 24 │         42.70 / 43.83 ±1.65 / 47.08 ms │                      42.73 / 45.70 ±3.14 / 49.77 ms │     no change │
│ QQuery 25 │      113.31 / 114.89 ±1.29 / 116.87 ms │                   115.11 / 116.69 ±1.72 / 119.71 ms │     no change │
│ QQuery 26 │         42.88 / 43.22 ±0.30 / 43.75 ms │                      43.29 / 43.67 ±0.33 / 44.27 ms │     no change │
│ QQuery 27 │      683.81 / 689.82 ±3.85 / 693.95 ms │                   674.34 / 683.84 ±6.38 / 693.50 ms │     no change │
│ QQuery 28 │  3025.58 / 3067.44 ±32.65 / 3117.57 ms │               3027.02 / 3060.71 ±25.44 / 3096.89 ms │     no change │
│ QQuery 29 │         42.74 / 48.01 ±9.81 / 67.63 ms │                      43.16 / 43.52 ±0.28 / 43.89 ms │ +1.10x faster │
│ QQuery 30 │      317.93 / 322.36 ±2.66 / 325.67 ms │                   322.42 / 331.76 ±6.34 / 341.33 ms │     no change │
│ QQuery 31 │      307.63 / 318.69 ±7.04 / 329.27 ms │                   320.20 / 327.35 ±6.86 / 335.90 ms │     no change │
│ QQuery 32 │   1035.59 / 1047.94 ±7.48 / 1056.42 ms │               1080.15 / 1102.66 ±18.02 / 1133.89 ms │  1.05x slower │
│ QQuery 33 │  1470.98 / 1506.92 ±26.64 / 1545.73 ms │               1487.08 / 1501.90 ±15.39 / 1530.28 ms │     no change │
│ QQuery 34 │  1566.59 / 1631.86 ±41.33 / 1695.01 ms │                1524.08 / 1533.08 ±6.59 / 1540.70 ms │ +1.06x faster │
│ QQuery 35 │     314.58 / 348.53 ±40.21 / 425.31 ms │                  308.99 / 356.76 ±56.54 / 463.80 ms │     no change │
│ QQuery 36 │         65.84 / 68.38 ±2.07 / 71.72 ms │                     64.18 / 70.99 ±10.16 / 91.15 ms │     no change │
│ QQuery 37 │         37.73 / 42.44 ±5.96 / 53.14 ms │                      36.99 / 41.34 ±3.54 / 46.15 ms │     no change │
│ QQuery 38 │         41.68 / 48.72 ±7.57 / 63.45 ms │                      41.97 / 50.36 ±8.76 / 65.11 ms │     no change │
│ QQuery 39 │      133.45 / 141.98 ±6.79 / 150.63 ms │                   132.57 / 139.73 ±5.14 / 144.64 ms │     no change │
│ QQuery 40 │         16.13 / 21.79 ±7.08 / 33.87 ms │                      15.09 / 16.27 ±1.52 / 19.17 ms │ +1.34x faster │
│ QQuery 41 │         14.91 / 15.58 ±0.66 / 16.85 ms │                      14.58 / 16.01 ±2.59 / 21.19 ms │     no change │
│ QQuery 42 │         14.77 / 15.99 ±2.10 / 20.18 ms │                      14.12 / 17.25 ±5.42 / 28.07 ms │  1.08x slower │
└───────────┴────────────────────────────────────────┴─────────────────────────────────────────────────────┴───────────────┘
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━┓
┃ Benchmark Summary                                                  ┃            ┃
┡━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━┩
│ Total Time (HEAD)                                                  │ 20742.66ms │
│ Total Time (experiment_roaring_bitmap_for_int32_anti_semi_joins)   │ 21255.24ms │
│ Average Time (HEAD)                                                │   482.39ms │
│ Average Time (experiment_roaring_bitmap_for_int32_anti_semi_joins) │   494.31ms │
│ Queries Faster                                                     │          3 │
│ Queries Slower                                                     │         15 │
│ Queries with No Change                                             │         25 │
│ Queries with Failure                                               │          0 │
└────────────────────────────────────────────────────────────────────┴────────────┘

Resource Usage

clickbench_partitioned — base (merge-base)

Metric Value
Wall time 105.0s
Peak memory 30.1 GiB
Avg memory 22.9 GiB
CPU user 1096.3s
CPU sys 68.2s
Peak spill 0 B

clickbench_partitioned — branch

Metric Value
Wall time 110.0s
Peak memory 29.8 GiB
Avg memory 22.8 GiB
CPU user 1118.0s
CPU sys 72.1s
Peak spill 0 B

File an issue against this benchmark runner

@Dandandan
Copy link
Copy Markdown
Contributor

I think it would be nice to avoid the roaring dependency.

A plain BooleanArray bitmap could work as well?

Comment thread datafusion/physical-plan/src/joins/hash_join/stream.rs Outdated
@coderfender
Copy link
Copy Markdown
Contributor Author

coderfender commented Apr 24, 2026

I think it would be nice to avoid the roaring dependency.

A plain BooleanArray bitmap could work as well?

@Dandandan , Thanks for the suggestion ! I considered using a plain BooleanArray bitmap for in32 types, but the challenge is memory usage for sparse key distributions where roaring would be a good fit. If lets say we have -Int max , 0 , +Int max we might be unduly allocating entire i32 range in memory which wouldnt be ideal.
Do you have concerns about the roaring dependency specifically (e.g., maintenance, compile time, binary size)?
Happy to explore further options or if I am missing something here ?

@2010YOUY01
Copy link
Copy Markdown
Contributor

Thank you for your comments . I plan to add benchmarks for hashjoin in a separate pr and rebase this feature once that is merged to main

  1. Re o(1) claim, the roaringbitmap given its size should be CPU cache friendly effectively making 'contains' checks o(1) (although theoretically they are log(n) to fetch containers and log(k) to find element . Given that the number of containers is small and fits in CPU cache I believe it is close to o(1) in most practical cases
  2. True, per my benchmarks (which I plan to add in separate PR) for HJ in semi / anti join cases, the dense checks were as fast as 2x while the sparse data was almost not effected. That said, we could definitely make this more intelligent by probing stats during planning time and only use roaring bitmaps if we could (albeit heuristically) decide there is dense probing required)

According to the physical design of roaring bitmaps, the index building and bulk membership testing should still be slower than an ideal hash map implementation. Roaring bitmaps are primarily designed for large, sparse bitmaps where they can provide compact memory usage, fast index iteration, and fast set operations such as union and intersection. However, index construction and contains checks seems not their primary strengths.

I suspect that the workloads where roaring bitmaps perform better has a lot of duplications on the build side, and that the current hash map implementation may be hitting some pathological cases 🤔

A recent PR (#21775) addresses one potential inefficiency, so we could compare the result with it.

This is a really interesting idea and observation, I'll try to dive deeper into hash join executor later to investigate further.

@coderfender
Copy link
Copy Markdown
Contributor Author

True . I added more benchmarking to hash joins in a separate PR @2010YOUY01 . Please take a look at that PR and once that is merged we should be able to better assess the performance of roaring bitmaps

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

Labels

physical-plan Changes to the physical-plan crate sqllogictest SQL Logic Tests (.slt)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants