Skip to content

feat: derive a distinct count from primary key and unique constraints - #24520

Open
Dandandan wants to merge 5 commits into
apache:mainfrom
Dandandan:feat/pk-cardinality-estimation
Open

feat: derive a distinct count from primary key and unique constraints#24520
Dandandan wants to merge 5 commits into
apache:mainfrom
Dandandan:feat/pk-cardinality-estimation

Conversation

@Dandandan

@Dandandan Dandandan commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

Which issue does this PR close?

Rationale for this change

From constraints on columns such as primary key / uniqueness we can derive distinct counts (number of rows = distinct counts).

This helps making it more accurate in cases when filtering / joining on those columns.

What changes are included in this PR?

Are there any user-facing changes?

A join has to estimate how many rows it produces, which needs the number of
distinct values in each key. No file format stores one, so a scan reports it
as unknown even for a column the table declares unique, and the estimate is
a guess.

A single-column primary key or unique constraint gives that number directly:
one distinct value per row, less the nulls a unique column may repeat. A
composite key says nothing about its columns on their own, so it is left
alone, and the count is inexact because constraints are not verified.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012YiAABcW4WSqij31zz2P6c
@github-actions github-actions Bot added the datasource Changes to the datasource crate label Aug 20, 2026
@codecov-commenter

codecov-commenter commented Aug 20, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 93.05556% with 15 lines in your changes missing coverage. Please review.
✅ Project coverage is 81.32%. Comparing base (858d3bf) to head (d16d257).
⚠️ Report is 9 commits behind head on main.

Files with missing lines Patch % Lines
datafusion/physical-plan/src/filter.rs 89.43% 1 Missing and 12 partials ⚠️
datafusion/datasource/src/file_scan_config/mod.rs 97.84% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #24520      +/-   ##
==========================================
+ Coverage   81.30%   81.32%   +0.01%     
==========================================
  Files        1117     1117              
  Lines      395881   396383     +502     
  Branches   395881   396383     +502     
==========================================
+ Hits       321886   322343     +457     
- Misses      55178    55197      +19     
- Partials    18817    18843      +26     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@Dandandan

Copy link
Copy Markdown
Contributor Author

run benchmarks

@adriangbot

Copy link
Copy Markdown

🤖 Benchmark running (GKE) | trigger
Instance: c4a-highmem-16 (12 vCPU / 65 GiB) | Linux bench-c5357542286-1808-vjpzh 6.12.85+ #1 SMP Sat Jun 27 09:31:30 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 feat/pk-cardinality-estimation (32d17cb) to 858d3bf (merge-base) diff

Run configuration
run benchmark tpch

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-c5357542286-1806-pd4tl 6.12.85+ #1 SMP Sat Jun 27 09:31:30 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 feat/pk-cardinality-estimation (32d17cb) to 858d3bf (merge-base) diff

Run configuration
run benchmark 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-c5357542286-1807-q472x 6.12.85+ #1 SMP Sat Jun 27 09:31:30 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 feat/pk-cardinality-estimation (32d17cb) to 858d3bf (merge-base) diff

Run configuration
run benchmark tpcds

Results will be posted here when complete


File an issue against this benchmark runner

@adriangbot

Copy link
Copy Markdown

🤖 Benchmark completed (GKE) | trigger

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

Comparing feat/pk-cardinality-estimation (32d17cb) to 858d3bf (merge-base) diff

Run configuration
run benchmark tpch
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 feat_pk-cardinality-estimation
--------------------
Benchmark tpch_sf1.json
--------------------
┏━━━━━━━━━━━┳━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━┓
┃ Query     ┃     HEAD ┃ feat_pk-cardinality-estimation ┃       Change ┃
┡━━━━━━━━━━━╇━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━┩
│ QQuery 1  │ 38.10 ms │                       38.01 ms │    no change │
│ QQuery 2  │ 18.90 ms │                       18.93 ms │    no change │
│ QQuery 3  │ 33.29 ms │                       31.79 ms │    no change │
│ QQuery 4  │ 17.37 ms │                       17.21 ms │    no change │
│ QQuery 5  │ 37.05 ms │                       37.48 ms │    no change │
│ QQuery 6  │ 16.00 ms │                       16.11 ms │    no change │
│ QQuery 7  │ 42.74 ms │                       43.45 ms │    no change │
│ QQuery 8  │ 41.89 ms │                       41.97 ms │    no change │
│ QQuery 9  │ 48.56 ms │                       49.35 ms │    no change │
│ QQuery 10 │ 41.69 ms │                       41.79 ms │    no change │
│ QQuery 11 │ 13.32 ms │                       13.12 ms │    no change │
│ QQuery 12 │ 24.12 ms │                       24.17 ms │    no change │
│ QQuery 13 │ 31.28 ms │                       31.80 ms │    no change │
│ QQuery 14 │ 23.07 ms │                       22.91 ms │    no change │
│ QQuery 15 │ 30.95 ms │                       30.39 ms │    no change │
│ QQuery 16 │ 14.36 ms │                       14.38 ms │    no change │
│ QQuery 17 │ 68.96 ms │                       75.48 ms │ 1.09x slower │
│ QQuery 18 │ 58.60 ms │                       61.71 ms │ 1.05x slower │
│ QQuery 19 │ 32.36 ms │                       33.65 ms │    no change │
│ QQuery 20 │ 31.40 ms │                       31.92 ms │    no change │
│ QQuery 21 │ 54.68 ms │                       56.89 ms │    no change │
│ QQuery 22 │ 13.74 ms │                       14.15 ms │    no change │
└───────────┴──────────┴────────────────────────────────┴──────────────┘
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━┓
┃ Benchmark Summary                             ┃          ┃
┡━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━┩
│ Total Time (HEAD)                             │ 732.44ms │
│ Total Time (feat_pk-cardinality-estimation)   │ 746.67ms │
│ Average Time (HEAD)                           │  33.29ms │
│ Average Time (feat_pk-cardinality-estimation) │  33.94ms │
│ Queries Faster                                │        0 │
│ Queries Slower                                │        2 │
│ Queries with No Change                        │       20 │
│ Queries with Failure                          │        0 │
└───────────────────────────────────────────────┴──────────┘

Distribution per query (min / mean ±stddev / max):

Comparing HEAD and feat_pk-cardinality-estimation
--------------------
Benchmark tpch_sf1.json
--------------------
┏━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━┓
┃ Query     ┃                           HEAD ┃ feat_pk-cardinality-estimation ┃        Change ┃
┡━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━┩
│ QQuery 1  │ 38.10 / 39.00 ±1.02 / 40.97 ms │ 38.01 / 38.84 ±1.00 / 40.72 ms │     no change │
│ QQuery 2  │ 18.90 / 19.58 ±0.40 / 20.07 ms │ 18.93 / 19.68 ±0.61 / 20.80 ms │     no change │
│ QQuery 3  │ 33.29 / 34.36 ±1.31 / 36.34 ms │ 31.79 / 32.53 ±0.65 / 33.62 ms │ +1.06x faster │
│ QQuery 4  │ 17.37 / 17.47 ±0.08 / 17.61 ms │ 17.21 / 17.33 ±0.13 / 17.57 ms │     no change │
│ QQuery 5  │ 37.05 / 38.64 ±1.14 / 39.93 ms │ 37.48 / 40.02 ±1.80 / 42.98 ms │     no change │
│ QQuery 6  │ 16.00 / 17.15 ±1.24 / 18.92 ms │ 16.11 / 17.31 ±1.24 / 19.01 ms │     no change │
│ QQuery 7  │ 42.74 / 44.72 ±1.26 / 46.11 ms │ 43.45 / 44.67 ±1.01 / 46.14 ms │     no change │
│ QQuery 8  │ 41.89 / 42.02 ±0.10 / 42.19 ms │ 41.97 / 42.26 ±0.38 / 43.00 ms │     no change │
│ QQuery 9  │ 48.56 / 51.02 ±2.25 / 54.66 ms │ 49.35 / 50.41 ±0.66 / 51.41 ms │     no change │
│ QQuery 10 │ 41.69 / 41.97 ±0.18 / 42.22 ms │ 41.79 / 42.42 ±1.08 / 44.57 ms │     no change │
│ QQuery 11 │ 13.32 / 13.44 ±0.17 / 13.78 ms │ 13.12 / 13.38 ±0.26 / 13.87 ms │     no change │
│ QQuery 12 │ 24.12 / 24.35 ±0.27 / 24.86 ms │ 24.17 / 24.43 ±0.18 / 24.65 ms │     no change │
│ QQuery 13 │ 31.28 / 33.50 ±2.40 / 37.91 ms │ 31.80 / 33.20 ±1.33 / 35.47 ms │     no change │
│ QQuery 14 │ 23.07 / 23.29 ±0.17 / 23.53 ms │ 22.91 / 23.08 ±0.16 / 23.37 ms │     no change │
│ QQuery 15 │ 30.95 / 32.54 ±1.35 / 34.49 ms │ 30.39 / 31.02 ±0.39 / 31.46 ms │     no change │
│ QQuery 16 │ 14.36 / 14.62 ±0.19 / 14.84 ms │ 14.38 / 14.43 ±0.03 / 14.48 ms │     no change │
│ QQuery 17 │ 68.96 / 69.55 ±0.57 / 70.29 ms │ 75.48 / 76.20 ±0.61 / 77.27 ms │  1.10x slower │
│ QQuery 18 │ 58.60 / 59.52 ±0.65 / 60.48 ms │ 61.71 / 63.74 ±2.09 / 67.63 ms │  1.07x slower │
│ QQuery 19 │ 32.36 / 33.57 ±1.55 / 36.59 ms │ 33.65 / 34.19 ±0.57 / 35.25 ms │     no change │
│ QQuery 20 │ 31.40 / 33.08 ±1.01 / 34.18 ms │ 31.92 / 32.52 ±0.32 / 32.84 ms │     no change │
│ QQuery 21 │ 54.68 / 56.14 ±0.76 / 56.82 ms │ 56.89 / 58.39 ±1.19 / 59.94 ms │     no change │
│ QQuery 22 │ 13.74 / 14.16 ±0.61 / 15.35 ms │ 14.15 / 14.48 ±0.49 / 15.42 ms │     no change │
└───────────┴────────────────────────────────┴────────────────────────────────┴───────────────┘
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━┓
┃ Benchmark Summary                             ┃          ┃
┡━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━┩
│ Total Time (HEAD)                             │ 753.70ms │
│ Total Time (feat_pk-cardinality-estimation)   │ 764.51ms │
│ Average Time (HEAD)                           │  34.26ms │
│ Average Time (feat_pk-cardinality-estimation) │  34.75ms │
│ Queries Faster                                │        1 │
│ Queries Slower                                │        2 │
│ Queries with No Change                        │       19 │
│ Queries with Failure                          │        0 │
└───────────────────────────────────────────────┴──────────┘

Resource Usage

tpch — base (merge-base)

Metric Value
Wall time 5.0s
Peak memory 1.3 GiB
Avg memory 525.9 MiB
CPU user 21.5s
CPU sys 1.7s
Peak spill 0 B

tpch — branch

Metric Value
Wall time 5.0s
Peak memory 1.2 GiB
Avg memory 520.3 MiB
CPU user 22.1s
CPU sys 1.6s
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)

Comparing feat/pk-cardinality-estimation (32d17cb) to 858d3bf (merge-base) diff

Run configuration
run benchmark tpcds
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 feat_pk-cardinality-estimation
--------------------
Benchmark tpcds_sf1.json
--------------------
┏━━━━━━━━━━━┳━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━┓
┃ Query     ┃       HEAD ┃ feat_pk-cardinality-estimation ┃        Change ┃
┡━━━━━━━━━━━╇━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━┩
│ QQuery 1  │    5.82 ms │                        5.66 ms │     no change │
│ QQuery 2  │   81.92 ms │                       80.83 ms │     no change │
│ QQuery 3  │   28.90 ms │                       28.93 ms │     no change │
│ QQuery 4  │  503.98 ms │                      500.14 ms │     no change │
│ QQuery 5  │   51.70 ms │                       51.77 ms │     no change │
│ QQuery 6  │   36.62 ms │                       35.94 ms │     no change │
│ QQuery 7  │   94.76 ms │                       94.34 ms │     no change │
│ QQuery 8  │   37.33 ms │                       36.73 ms │     no change │
│ QQuery 9  │   51.28 ms │                       50.88 ms │     no change │
│ QQuery 10 │   62.43 ms │                       62.95 ms │     no change │
│ QQuery 11 │  310.47 ms │                      315.66 ms │     no change │
│ QQuery 12 │   29.20 ms │                       29.21 ms │     no change │
│ QQuery 13 │  117.89 ms │                      117.88 ms │     no change │
│ QQuery 14 │  416.36 ms │                      415.77 ms │     no change │
│ QQuery 15 │   58.81 ms │                       58.42 ms │     no change │
│ QQuery 16 │    6.77 ms │                        6.84 ms │     no change │
│ QQuery 17 │   80.56 ms │                       80.13 ms │     no change │
│ QQuery 18 │  123.43 ms │                      124.60 ms │     no change │
│ QQuery 19 │   41.42 ms │                       41.40 ms │     no change │
│ QQuery 20 │   35.95 ms │                       36.10 ms │     no change │
│ QQuery 21 │   17.30 ms │                       17.58 ms │     no change │
│ QQuery 22 │   62.61 ms │                       63.94 ms │     no change │
│ QQuery 23 │  351.95 ms │                      313.25 ms │ +1.12x faster │
│ QQuery 24 │  224.80 ms │                      225.15 ms │     no change │
│ QQuery 25 │  110.27 ms │                      110.09 ms │     no change │
│ QQuery 26 │   59.17 ms │                       58.34 ms │     no change │
│ QQuery 27 │    6.57 ms │                        6.54 ms │     no change │
│ QQuery 28 │   60.16 ms │                       55.71 ms │ +1.08x faster │
│ QQuery 29 │   96.78 ms │                       96.50 ms │     no change │
│ QQuery 30 │   33.26 ms │                       32.65 ms │     no change │
│ QQuery 31 │  111.12 ms │                      109.91 ms │     no change │
│ QQuery 32 │   20.77 ms │                       20.57 ms │     no change │
│ QQuery 33 │   38.39 ms │                       37.63 ms │     no change │
│ QQuery 34 │   10.32 ms │                       10.12 ms │     no change │
│ QQuery 35 │   73.31 ms │                       73.71 ms │     no change │
│ QQuery 36 │    6.04 ms │                        5.82 ms │     no change │
│ QQuery 37 │    7.04 ms │                        6.96 ms │     no change │
│ QQuery 38 │   62.73 ms │                       62.48 ms │     no change │
│ QQuery 39 │   90.81 ms │                       90.42 ms │     no change │
│ QQuery 40 │   23.32 ms │                       23.35 ms │     no change │
│ QQuery 41 │   11.35 ms │                       11.32 ms │     no change │
│ QQuery 42 │   23.61 ms │                       23.57 ms │     no change │
│ QQuery 43 │    5.30 ms │                        5.28 ms │     no change │
│ QQuery 44 │    9.34 ms │                        9.42 ms │     no change │
│ QQuery 45 │   39.39 ms │                       38.50 ms │     no change │
│ QQuery 46 │   12.37 ms │                       12.04 ms │     no change │
│ QQuery 47 │  229.70 ms │                      228.18 ms │     no change │
│ QQuery 48 │   95.42 ms │                       95.20 ms │     no change │
│ QQuery 49 │   76.60 ms │                       76.44 ms │     no change │
│ QQuery 50 │   59.34 ms │                       59.28 ms │     no change │
│ QQuery 51 │   89.62 ms │                       91.81 ms │     no change │
│ QQuery 52 │   24.18 ms │                       24.00 ms │     no change │
│ QQuery 53 │   29.57 ms │                       29.12 ms │     no change │
│ QQuery 54 │   55.61 ms │                       54.84 ms │     no change │
│ QQuery 55 │   23.45 ms │                       23.51 ms │     no change │
│ QQuery 56 │   38.80 ms │                       39.03 ms │     no change │
│ QQuery 57 │  177.05 ms │                      176.59 ms │     no change │
│ QQuery 58 │  115.03 ms │                      113.89 ms │     no change │
│ QQuery 59 │  119.19 ms │                      118.62 ms │     no change │
│ QQuery 60 │   39.76 ms │                       39.50 ms │     no change │
│ QQuery 61 │   12.79 ms │                       12.59 ms │     no change │
│ QQuery 62 │   47.61 ms │                       46.58 ms │     no change │
│ QQuery 63 │   29.36 ms │                       29.23 ms │     no change │
│ QQuery 64 │  409.49 ms │                      407.64 ms │     no change │
│ QQuery 65 │  119.99 ms │                      124.13 ms │     no change │
│ QQuery 66 │   82.66 ms │                       82.55 ms │     no change │
│ QQuery 67 │  244.87 ms │                      254.09 ms │     no change │
│ QQuery 68 │   12.09 ms │                       12.41 ms │     no change │
│ QQuery 69 │   57.23 ms │                       57.35 ms │     no change │
│ QQuery 70 │  107.40 ms │                      106.54 ms │     no change │
│ QQuery 71 │   35.00 ms │                       35.17 ms │     no change │
│ QQuery 72 │ 2028.66 ms │                     2098.47 ms │     no change │
│ QQuery 73 │    9.78 ms │                        9.83 ms │     no change │
│ QQuery 74 │  175.09 ms │                      174.11 ms │     no change │
│ QQuery 75 │  149.69 ms │                      149.62 ms │     no change │
│ QQuery 76 │   35.54 ms │                       35.51 ms │     no change │
│ QQuery 77 │   60.95 ms │                       61.54 ms │     no change │
│ QQuery 78 │  197.35 ms │                      196.15 ms │     no change │
│ QQuery 79 │   67.26 ms │                       66.68 ms │     no change │
│ QQuery 80 │   98.83 ms │                       99.55 ms │     no change │
│ QQuery 81 │   26.19 ms │                       26.29 ms │     no change │
│ QQuery 82 │   16.43 ms │                       16.23 ms │     no change │
│ QQuery 83 │   40.05 ms │                       39.76 ms │     no change │
│ QQuery 84 │   30.09 ms │                       29.83 ms │     no change │
│ QQuery 85 │  107.26 ms │                      106.29 ms │     no change │
│ QQuery 86 │   25.53 ms │                       25.40 ms │     no change │
│ QQuery 87 │   62.21 ms │                       61.97 ms │     no change │
│ QQuery 88 │   64.09 ms │                       62.86 ms │     no change │
│ QQuery 89 │   35.80 ms │                       35.27 ms │     no change │
│ QQuery 90 │   17.37 ms │                       17.33 ms │     no change │
│ QQuery 91 │   46.64 ms │                       46.34 ms │     no change │
│ QQuery 92 │   29.93 ms │                       29.86 ms │     no change │
│ QQuery 93 │   50.71 ms │                       50.51 ms │     no change │
│ QQuery 94 │   38.18 ms │                       37.87 ms │     no change │
│ QQuery 95 │   80.66 ms │                       78.88 ms │     no change │
│ QQuery 96 │   24.27 ms │                       23.67 ms │     no change │
│ QQuery 97 │   46.63 ms │                       46.91 ms │     no change │
│ QQuery 98 │   42.83 ms │                       42.99 ms │     no change │
│ QQuery 99 │   70.83 ms │                       70.53 ms │     no change │
└───────────┴────────────┴────────────────────────────────┴───────────────┘
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━┓
┃ Benchmark Summary                             ┃           ┃
┡━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━┩
│ Total Time (HEAD)                             │ 9754.36ms │
│ Total Time (feat_pk-cardinality-estimation)   │ 9773.62ms │
│ Average Time (HEAD)                           │   98.53ms │
│ Average Time (feat_pk-cardinality-estimation) │   98.72ms │
│ Queries Faster                                │         2 │
│ Queries Slower                                │         0 │
│ Queries with No Change                        │        97 │
│ Queries with Failure                          │         0 │
└───────────────────────────────────────────────┴───────────┘

Distribution per query (min / mean ±stddev / max):

Comparing HEAD and feat_pk-cardinality-estimation
--------------------
Benchmark tpcds_sf1.json
--------------------
┏━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━┓
┃ Query     ┃                                  HEAD ┃        feat_pk-cardinality-estimation ┃        Change ┃
┡━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━┩
│ QQuery 1  │           5.82 / 6.37 ±0.84 / 8.03 ms │           5.66 / 6.15 ±0.94 / 8.02 ms │     no change │
│ QQuery 2  │        81.92 / 82.51 ±0.36 / 82.99 ms │        80.83 / 81.30 ±0.26 / 81.62 ms │     no change │
│ QQuery 3  │        28.90 / 29.21 ±0.20 / 29.42 ms │        28.93 / 29.36 ±0.23 / 29.57 ms │     no change │
│ QQuery 4  │     503.98 / 506.62 ±1.68 / 508.24 ms │     500.14 / 506.11 ±4.64 / 513.28 ms │     no change │
│ QQuery 5  │        51.70 / 52.60 ±0.73 / 53.79 ms │        51.77 / 52.09 ±0.21 / 52.37 ms │     no change │
│ QQuery 6  │        36.62 / 36.92 ±0.19 / 37.16 ms │        35.94 / 36.41 ±0.35 / 36.92 ms │     no change │
│ QQuery 7  │        94.76 / 96.34 ±1.65 / 99.54 ms │        94.34 / 95.63 ±1.76 / 99.11 ms │     no change │
│ QQuery 8  │        37.33 / 37.74 ±0.46 / 38.64 ms │        36.73 / 37.76 ±0.80 / 38.78 ms │     no change │
│ QQuery 9  │        51.28 / 53.40 ±1.71 / 55.54 ms │        50.88 / 52.92 ±1.59 / 55.08 ms │     no change │
│ QQuery 10 │        62.43 / 63.25 ±0.62 / 64.24 ms │        62.95 / 63.23 ±0.29 / 63.78 ms │     no change │
│ QQuery 11 │     310.47 / 316.95 ±4.53 / 321.79 ms │     315.66 / 323.42 ±6.05 / 330.50 ms │     no change │
│ QQuery 12 │        29.20 / 29.59 ±0.27 / 30.04 ms │        29.21 / 29.60 ±0.30 / 29.94 ms │     no change │
│ QQuery 13 │     117.89 / 120.49 ±2.66 / 125.33 ms │     117.88 / 119.54 ±1.34 / 121.97 ms │     no change │
│ QQuery 14 │     416.36 / 424.85 ±6.14 / 432.37 ms │     415.77 / 424.62 ±7.22 / 436.31 ms │     no change │
│ QQuery 15 │        58.81 / 59.68 ±0.58 / 60.44 ms │        58.42 / 59.51 ±0.71 / 60.52 ms │     no change │
│ QQuery 16 │           6.77 / 6.90 ±0.20 / 7.31 ms │           6.84 / 7.04 ±0.22 / 7.45 ms │     no change │
│ QQuery 17 │        80.56 / 81.75 ±1.28 / 84.11 ms │        80.13 / 81.32 ±1.28 / 83.73 ms │     no change │
│ QQuery 18 │     123.43 / 125.36 ±1.08 / 126.57 ms │     124.60 / 128.53 ±5.23 / 138.78 ms │     no change │
│ QQuery 19 │        41.42 / 41.79 ±0.38 / 42.49 ms │        41.40 / 41.73 ±0.28 / 42.17 ms │     no change │
│ QQuery 20 │        35.95 / 37.40 ±1.65 / 40.58 ms │        36.10 / 37.46 ±1.32 / 39.49 ms │     no change │
│ QQuery 21 │        17.30 / 18.25 ±1.35 / 20.93 ms │        17.58 / 17.89 ±0.16 / 18.02 ms │     no change │
│ QQuery 22 │        62.61 / 64.45 ±1.17 / 66.23 ms │        63.94 / 64.92 ±0.99 / 66.45 ms │     no change │
│ QQuery 23 │     351.95 / 356.03 ±4.41 / 363.23 ms │     313.25 / 320.59 ±4.60 / 326.86 ms │ +1.11x faster │
│ QQuery 24 │     224.80 / 227.68 ±3.73 / 235.03 ms │     225.15 / 227.48 ±3.57 / 234.50 ms │     no change │
│ QQuery 25 │     110.27 / 111.05 ±0.91 / 112.77 ms │     110.09 / 110.58 ±0.34 / 111.04 ms │     no change │
│ QQuery 26 │        59.17 / 60.29 ±1.38 / 63.02 ms │        58.34 / 60.97 ±2.91 / 65.04 ms │     no change │
│ QQuery 27 │           6.57 / 6.72 ±0.10 / 6.88 ms │           6.54 / 6.76 ±0.12 / 6.87 ms │     no change │
│ QQuery 28 │        60.16 / 61.12 ±0.66 / 61.99 ms │        55.71 / 59.12 ±2.85 / 62.85 ms │     no change │
│ QQuery 29 │       96.78 / 99.92 ±5.29 / 110.43 ms │        96.50 / 98.15 ±1.06 / 99.21 ms │     no change │
│ QQuery 30 │        33.26 / 33.54 ±0.27 / 34.05 ms │        32.65 / 34.05 ±1.39 / 36.71 ms │     no change │
│ QQuery 31 │     111.12 / 111.56 ±0.25 / 111.77 ms │     109.91 / 111.37 ±1.43 / 114.09 ms │     no change │
│ QQuery 32 │        20.77 / 21.05 ±0.20 / 21.40 ms │        20.57 / 20.77 ±0.32 / 21.41 ms │     no change │
│ QQuery 33 │        38.39 / 39.09 ±0.85 / 40.57 ms │        37.63 / 38.14 ±0.39 / 38.66 ms │     no change │
│ QQuery 34 │        10.32 / 10.63 ±0.38 / 11.38 ms │        10.12 / 10.27 ±0.19 / 10.65 ms │     no change │
│ QQuery 35 │        73.31 / 74.31 ±0.89 / 75.83 ms │        73.71 / 74.47 ±0.75 / 75.64 ms │     no change │
│ QQuery 36 │           6.04 / 6.21 ±0.20 / 6.60 ms │           5.82 / 5.98 ±0.13 / 6.23 ms │     no change │
│ QQuery 37 │           7.04 / 7.18 ±0.09 / 7.27 ms │           6.96 / 7.02 ±0.04 / 7.06 ms │     no change │
│ QQuery 38 │        62.73 / 63.31 ±0.32 / 63.69 ms │        62.48 / 63.07 ±0.34 / 63.51 ms │     no change │
│ QQuery 39 │        90.81 / 91.85 ±0.63 / 92.61 ms │        90.42 / 92.14 ±1.19 / 93.92 ms │     no change │
│ QQuery 40 │        23.32 / 23.66 ±0.36 / 24.32 ms │        23.35 / 23.60 ±0.14 / 23.80 ms │     no change │
│ QQuery 41 │        11.35 / 11.53 ±0.15 / 11.79 ms │        11.32 / 11.52 ±0.21 / 11.90 ms │     no change │
│ QQuery 42 │        23.61 / 23.82 ±0.20 / 24.15 ms │        23.57 / 23.95 ±0.58 / 25.09 ms │     no change │
│ QQuery 43 │           5.30 / 5.46 ±0.19 / 5.83 ms │           5.28 / 5.42 ±0.20 / 5.83 ms │     no change │
│ QQuery 44 │          9.34 / 9.70 ±0.23 / 10.03 ms │           9.42 / 9.49 ±0.09 / 9.66 ms │     no change │
│ QQuery 45 │        39.39 / 40.01 ±0.45 / 40.79 ms │        38.50 / 39.29 ±0.44 / 39.80 ms │     no change │
│ QQuery 46 │        12.37 / 13.59 ±1.74 / 16.99 ms │        12.04 / 12.34 ±0.24 / 12.73 ms │ +1.10x faster │
│ QQuery 47 │     229.70 / 233.24 ±3.51 / 239.12 ms │     228.18 / 232.85 ±4.22 / 239.67 ms │     no change │
│ QQuery 48 │        95.42 / 96.42 ±1.01 / 98.20 ms │        95.20 / 95.82 ±0.42 / 96.41 ms │     no change │
│ QQuery 49 │        76.60 / 78.86 ±3.34 / 85.49 ms │        76.44 / 77.28 ±0.79 / 78.75 ms │     no change │
│ QQuery 50 │        59.34 / 60.55 ±1.20 / 62.84 ms │        59.28 / 61.00 ±1.64 / 63.54 ms │     no change │
│ QQuery 51 │        89.62 / 93.00 ±1.73 / 94.45 ms │        91.81 / 92.49 ±0.43 / 92.97 ms │     no change │
│ QQuery 52 │        24.18 / 24.38 ±0.15 / 24.64 ms │        24.00 / 24.29 ±0.20 / 24.55 ms │     no change │
│ QQuery 53 │        29.57 / 31.56 ±2.69 / 36.79 ms │        29.12 / 29.52 ±0.48 / 30.39 ms │ +1.07x faster │
│ QQuery 54 │        55.61 / 56.29 ±0.35 / 56.59 ms │        54.84 / 56.61 ±2.02 / 59.31 ms │     no change │
│ QQuery 55 │        23.45 / 23.98 ±0.35 / 24.55 ms │        23.51 / 23.87 ±0.36 / 24.55 ms │     no change │
│ QQuery 56 │        38.80 / 39.45 ±0.67 / 40.72 ms │        39.03 / 39.24 ±0.29 / 39.80 ms │     no change │
│ QQuery 57 │     177.05 / 179.37 ±2.45 / 183.75 ms │     176.59 / 179.59 ±3.37 / 186.04 ms │     no change │
│ QQuery 58 │     115.03 / 117.15 ±1.84 / 120.21 ms │     113.89 / 114.98 ±1.16 / 116.66 ms │     no change │
│ QQuery 59 │     119.19 / 119.98 ±0.58 / 120.94 ms │     118.62 / 119.48 ±1.23 / 121.89 ms │     no change │
│ QQuery 60 │        39.76 / 40.23 ±0.30 / 40.56 ms │        39.50 / 39.96 ±0.52 / 40.80 ms │     no change │
│ QQuery 61 │        12.79 / 13.87 ±1.90 / 17.67 ms │        12.59 / 12.80 ±0.13 / 12.95 ms │ +1.08x faster │
│ QQuery 62 │        47.61 / 48.30 ±0.73 / 49.67 ms │        46.58 / 46.75 ±0.15 / 46.96 ms │     no change │
│ QQuery 63 │        29.36 / 29.78 ±0.52 / 30.79 ms │        29.23 / 30.85 ±2.65 / 36.14 ms │     no change │
│ QQuery 64 │     409.49 / 413.10 ±2.48 / 416.42 ms │     407.64 / 416.66 ±7.17 / 428.26 ms │     no change │
│ QQuery 65 │     119.99 / 126.13 ±3.54 / 131.01 ms │     124.13 / 125.10 ±0.71 / 126.23 ms │     no change │
│ QQuery 66 │        82.66 / 83.79 ±0.83 / 84.97 ms │        82.55 / 84.93 ±3.96 / 92.83 ms │     no change │
│ QQuery 67 │     244.87 / 250.27 ±4.71 / 257.87 ms │     254.09 / 262.54 ±6.44 / 272.01 ms │     no change │
│ QQuery 68 │        12.09 / 12.30 ±0.21 / 12.60 ms │        12.41 / 12.51 ±0.10 / 12.69 ms │     no change │
│ QQuery 69 │        57.23 / 59.84 ±4.47 / 68.76 ms │        57.35 / 57.57 ±0.17 / 57.83 ms │     no change │
│ QQuery 70 │     107.40 / 110.69 ±2.46 / 113.57 ms │    106.54 / 114.02 ±10.72 / 135.13 ms │     no change │
│ QQuery 71 │        35.00 / 36.25 ±1.25 / 38.65 ms │        35.17 / 35.84 ±0.40 / 36.37 ms │     no change │
│ QQuery 72 │ 2028.66 / 2130.29 ±60.44 / 2200.41 ms │ 2098.47 / 2163.02 ±52.59 / 2249.50 ms │     no change │
│ QQuery 73 │         9.78 / 10.12 ±0.22 / 10.47 ms │         9.83 / 10.07 ±0.30 / 10.66 ms │     no change │
│ QQuery 74 │     175.09 / 177.84 ±2.30 / 181.97 ms │     174.11 / 178.30 ±4.45 / 184.98 ms │     no change │
│ QQuery 75 │     149.69 / 153.00 ±3.04 / 157.27 ms │     149.62 / 152.42 ±4.56 / 161.49 ms │     no change │
│ QQuery 76 │        35.54 / 35.75 ±0.18 / 36.10 ms │        35.51 / 35.92 ±0.35 / 36.54 ms │     no change │
│ QQuery 77 │        60.95 / 61.56 ±0.46 / 62.12 ms │        61.54 / 62.17 ±0.51 / 63.11 ms │     no change │
│ QQuery 78 │     197.35 / 202.45 ±4.39 / 210.16 ms │     196.15 / 202.79 ±4.21 / 207.97 ms │     no change │
│ QQuery 79 │        67.26 / 68.55 ±2.39 / 73.33 ms │        66.68 / 67.03 ±0.25 / 67.28 ms │     no change │
│ QQuery 80 │      98.83 / 100.41 ±1.87 / 103.36 ms │      99.55 / 103.05 ±4.84 / 112.64 ms │     no change │
│ QQuery 81 │        26.19 / 26.57 ±0.19 / 26.72 ms │        26.29 / 26.43 ±0.13 / 26.60 ms │     no change │
│ QQuery 82 │        16.43 / 16.52 ±0.09 / 16.69 ms │        16.23 / 16.47 ±0.13 / 16.60 ms │     no change │
│ QQuery 83 │        40.05 / 40.77 ±0.72 / 42.13 ms │        39.76 / 40.18 ±0.25 / 40.50 ms │     no change │
│ QQuery 84 │        30.09 / 32.54 ±2.77 / 36.91 ms │        29.83 / 32.44 ±3.14 / 36.87 ms │     no change │
│ QQuery 85 │     107.26 / 107.94 ±0.57 / 108.60 ms │     106.29 / 107.92 ±1.19 / 109.84 ms │     no change │
│ QQuery 86 │        25.53 / 26.17 ±0.56 / 27.21 ms │        25.40 / 25.66 ±0.17 / 25.86 ms │     no change │
│ QQuery 87 │        62.21 / 65.38 ±2.36 / 68.87 ms │        61.97 / 63.55 ±1.96 / 67.33 ms │     no change │
│ QQuery 88 │        64.09 / 64.36 ±0.25 / 64.72 ms │        62.86 / 63.86 ±0.60 / 64.70 ms │     no change │
│ QQuery 89 │        35.80 / 36.16 ±0.42 / 36.75 ms │        35.27 / 35.69 ±0.37 / 36.20 ms │     no change │
│ QQuery 90 │        17.37 / 17.70 ±0.27 / 18.05 ms │        17.33 / 17.59 ±0.17 / 17.85 ms │     no change │
│ QQuery 91 │        46.64 / 46.85 ±0.13 / 46.96 ms │        46.34 / 46.77 ±0.32 / 47.19 ms │     no change │
│ QQuery 92 │        29.93 / 32.64 ±2.82 / 37.24 ms │        29.86 / 30.48 ±0.98 / 32.43 ms │ +1.07x faster │
│ QQuery 93 │        50.71 / 51.45 ±0.42 / 51.83 ms │        50.51 / 52.06 ±2.43 / 56.85 ms │     no change │
│ QQuery 94 │        38.18 / 38.56 ±0.28 / 38.91 ms │        37.87 / 38.33 ±0.42 / 39.08 ms │     no change │
│ QQuery 95 │        80.66 / 81.22 ±0.57 / 82.29 ms │        78.88 / 80.24 ±0.74 / 81.04 ms │     no change │
│ QQuery 96 │        24.27 / 26.58 ±2.99 / 32.01 ms │        23.67 / 23.99 ±0.27 / 24.32 ms │ +1.11x faster │
│ QQuery 97 │        46.63 / 47.85 ±0.99 / 49.54 ms │        46.91 / 48.59 ±1.76 / 51.08 ms │     no change │
│ QQuery 98 │        42.83 / 43.60 ±0.42 / 44.01 ms │        42.99 / 43.38 ±0.49 / 44.34 ms │     no change │
│ QQuery 99 │        70.83 / 71.24 ±0.31 / 71.64 ms │        70.53 / 71.01 ±0.42 / 71.68 ms │     no change │
└───────────┴───────────────────────────────────────┴───────────────────────────────────────┴───────────────┘
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━┓
┃ Benchmark Summary                             ┃           ┃
┡━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━┩
│ Total Time (HEAD)                             │ 9994.52ms │
│ Total Time (feat_pk-cardinality-estimation)   │ 9989.03ms │
│ Average Time (HEAD)                           │  100.95ms │
│ Average Time (feat_pk-cardinality-estimation) │  100.90ms │
│ Queries Faster                                │         6 │
│ Queries Slower                                │         0 │
│ Queries with No Change                        │        93 │
│ Queries with Failure                          │         0 │
└───────────────────────────────────────────────┴───────────┘

Resource Usage

tpcds — base (merge-base)

Metric Value
Wall time 55.0s
Peak memory 2.0 GiB
Avg memory 1.4 GiB
CPU user 221.7s
CPU sys 5.6s
Peak spill 0 B

tpcds — branch

Metric Value
Wall time 55.0s
Peak memory 1.9 GiB
Avg memory 1.3 GiB
CPU user 224.8s
CPU sys 5.9s
Peak spill 0 B

File an issue against this benchmark runner

@Dandandan
Dandandan marked this pull request as ready for review August 20, 2026 15:11
@adriangbot

Copy link
Copy Markdown

🤖 Benchmark completed (GKE) | trigger

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

Comparing feat/pk-cardinality-estimation (32d17cb) to 858d3bf (merge-base) diff

Run configuration
run benchmark clickbench_partitioned
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 feat_pk-cardinality-estimation
--------------------
Benchmark clickbench_partitioned.json
--------------------
┏━━━━━━━━━━━┳━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━┓
┃ Query     ┃       HEAD ┃ feat_pk-cardinality-estimation ┃        Change ┃
┡━━━━━━━━━━━╇━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━┩
│ QQuery 0  │    1.25 ms │                        1.26 ms │     no change │
│ QQuery 1  │   12.55 ms │                       12.35 ms │     no change │
│ QQuery 2  │   36.29 ms │                       36.08 ms │     no change │
│ QQuery 3  │   31.96 ms │                       31.52 ms │     no change │
│ QQuery 4  │  236.20 ms │                      233.72 ms │     no change │
│ QQuery 5  │  277.55 ms │                      280.95 ms │     no change │
│ QQuery 6  │    1.27 ms │                        1.28 ms │     no change │
│ QQuery 7  │   13.50 ms │                       13.24 ms │     no change │
│ QQuery 8  │  335.23 ms │                      328.93 ms │     no change │
│ QQuery 9  │  479.08 ms │                      453.51 ms │ +1.06x faster │
│ QQuery 10 │   72.25 ms │                       70.76 ms │     no change │
│ QQuery 11 │   82.32 ms │                       81.58 ms │     no change │
│ QQuery 12 │  281.73 ms │                      276.99 ms │     no change │
│ QQuery 13 │  372.19 ms │                      398.31 ms │  1.07x slower │
│ QQuery 14 │  284.65 ms │                      296.60 ms │     no change │
│ QQuery 15 │  280.43 ms │                      297.48 ms │  1.06x slower │
│ QQuery 16 │  628.84 ms │                      654.29 ms │     no change │
│ QQuery 17 │  639.30 ms │                      683.25 ms │  1.07x slower │
│ QQuery 18 │ 1263.53 ms │                     1388.15 ms │  1.10x slower │
│ QQuery 19 │   28.35 ms │                       29.35 ms │     no change │
│ QQuery 20 │  522.52 ms │                      537.82 ms │     no change │
│ QQuery 21 │  519.20 ms │                      540.89 ms │     no change │
│ QQuery 22 │  992.37 ms │                     1040.70 ms │     no change │
│ QQuery 23 │ 3108.38 ms │                     3185.17 ms │     no change │
│ QQuery 24 │   41.93 ms │                       43.32 ms │     no change │
│ QQuery 25 │  110.73 ms │                      114.86 ms │     no change │
│ QQuery 26 │   41.89 ms │                       43.97 ms │     no change │
│ QQuery 27 │  515.24 ms │                      533.46 ms │     no change │
│ QQuery 28 │ 2917.70 ms │                     3033.30 ms │     no change │
│ QQuery 29 │   41.26 ms │                       41.96 ms │     no change │
│ QQuery 30 │  308.06 ms │                      326.79 ms │  1.06x slower │
│ QQuery 31 │  286.17 ms │                      299.26 ms │     no change │
│ QQuery 32 │  945.02 ms │                     1021.14 ms │  1.08x slower │
│ QQuery 33 │ 1485.45 ms │                     1622.91 ms │  1.09x slower │
│ QQuery 34 │ 1511.38 ms │                     1647.61 ms │  1.09x slower │
│ QQuery 35 │  287.76 ms │                      333.42 ms │  1.16x slower │
│ QQuery 36 │   68.09 ms │                       69.69 ms │     no change │
│ QQuery 37 │   36.44 ms │                       37.77 ms │     no change │
│ QQuery 38 │   43.53 ms │                       44.73 ms │     no change │
│ QQuery 39 │  151.31 ms │                      160.27 ms │  1.06x slower │
│ QQuery 40 │   14.80 ms │                       15.43 ms │     no change │
│ QQuery 41 │   14.25 ms │                       14.86 ms │     no change │
│ QQuery 42 │   13.76 ms │                       14.48 ms │  1.05x slower │
└───────────┴────────────┴────────────────────────────────┴───────────────┘
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━┓
┃ Benchmark Summary                             ┃            ┃
┡━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━┩
│ Total Time (HEAD)                             │ 19335.72ms │
│ Total Time (feat_pk-cardinality-estimation)   │ 20293.42ms │
│ Average Time (HEAD)                           │   449.67ms │
│ Average Time (feat_pk-cardinality-estimation) │   471.94ms │
│ Queries Faster                                │          1 │
│ Queries Slower                                │         11 │
│ Queries with No Change                        │         31 │
│ Queries with Failure                          │          0 │
└───────────────────────────────────────────────┴────────────┘

Distribution per query (min / mean ±stddev / max):

Comparing HEAD and feat_pk-cardinality-estimation
--------------------
Benchmark clickbench_partitioned.json
--------------------
┏━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━┓
┃ Query     ┃                                  HEAD ┃        feat_pk-cardinality-estimation ┃        Change ┃
┡━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━┩
│ QQuery 0  │          1.25 / 4.12 ±5.61 / 15.33 ms │          1.26 / 4.13 ±5.59 / 15.30 ms │     no change │
│ QQuery 1  │        12.55 / 12.80 ±0.25 / 13.28 ms │        12.35 / 12.59 ±0.19 / 12.86 ms │     no change │
│ QQuery 2  │        36.29 / 36.78 ±0.31 / 37.15 ms │        36.08 / 36.47 ±0.30 / 36.82 ms │     no change │
│ QQuery 3  │        31.96 / 32.52 ±0.47 / 33.35 ms │        31.52 / 31.81 ±0.23 / 32.20 ms │     no change │
│ QQuery 4  │     236.20 / 239.86 ±4.01 / 247.33 ms │     233.72 / 237.20 ±2.98 / 242.64 ms │     no change │
│ QQuery 5  │     277.55 / 280.03 ±1.87 / 282.55 ms │     280.95 / 285.46 ±3.77 / 290.23 ms │     no change │
│ QQuery 6  │           1.27 / 1.41 ±0.22 / 1.85 ms │           1.28 / 1.43 ±0.21 / 1.84 ms │     no change │
│ QQuery 7  │        13.50 / 13.80 ±0.19 / 14.09 ms │        13.24 / 13.42 ±0.09 / 13.50 ms │     no change │
│ QQuery 8  │     335.23 / 341.17 ±4.56 / 348.14 ms │    328.93 / 342.63 ±12.17 / 360.10 ms │     no change │
│ QQuery 9  │    479.08 / 490.67 ±14.24 / 517.07 ms │     453.51 / 471.05 ±9.57 / 482.85 ms │     no change │
│ QQuery 10 │        72.25 / 73.20 ±1.41 / 75.99 ms │        70.76 / 74.66 ±3.56 / 79.87 ms │     no change │
│ QQuery 11 │        82.32 / 82.88 ±0.51 / 83.71 ms │        81.58 / 84.21 ±3.25 / 90.44 ms │     no change │
│ QQuery 12 │     281.73 / 286.03 ±2.75 / 290.05 ms │     276.99 / 284.38 ±4.60 / 290.60 ms │     no change │
│ QQuery 13 │    372.19 / 387.03 ±10.70 / 400.02 ms │     398.31 / 407.39 ±8.36 / 422.19 ms │  1.05x slower │
│ QQuery 14 │     284.65 / 291.91 ±4.43 / 297.87 ms │     296.60 / 307.49 ±7.87 / 319.95 ms │  1.05x slower │
│ QQuery 15 │     280.43 / 287.07 ±9.44 / 305.03 ms │    297.48 / 311.86 ±14.52 / 339.23 ms │  1.09x slower │
│ QQuery 16 │     628.84 / 639.82 ±7.97 / 652.59 ms │    654.29 / 677.07 ±15.95 / 700.59 ms │  1.06x slower │
│ QQuery 17 │     639.30 / 649.84 ±6.96 / 657.74 ms │     683.25 / 689.26 ±8.40 / 705.90 ms │  1.06x slower │
│ QQuery 18 │ 1263.53 / 1291.90 ±18.56 / 1314.24 ms │ 1388.15 / 1410.45 ±14.17 / 1429.43 ms │  1.09x slower │
│ QQuery 19 │        28.35 / 35.29 ±7.39 / 45.21 ms │      29.35 / 49.30 ±35.82 / 120.83 ms │  1.40x slower │
│ QQuery 20 │     522.52 / 533.07 ±8.59 / 544.29 ms │    537.82 / 548.62 ±13.71 / 574.90 ms │     no change │
│ QQuery 21 │     519.20 / 523.49 ±4.92 / 532.80 ms │     540.89 / 546.38 ±6.62 / 558.62 ms │     no change │
│ QQuery 22 │  992.37 / 1023.87 ±20.51 / 1052.09 ms │ 1040.70 / 1060.33 ±20.30 / 1091.82 ms │     no change │
│ QQuery 23 │ 3108.38 / 3148.06 ±28.26 / 3191.80 ms │ 3185.17 / 3259.04 ±50.81 / 3327.73 ms │     no change │
│ QQuery 24 │        41.93 / 46.39 ±6.45 / 58.84 ms │        43.32 / 43.48 ±0.12 / 43.59 ms │ +1.07x faster │
│ QQuery 25 │     110.73 / 116.43 ±7.44 / 131.06 ms │     114.86 / 122.67 ±8.64 / 138.73 ms │  1.05x slower │
│ QQuery 26 │        41.89 / 42.90 ±0.89 / 44.14 ms │        43.97 / 46.34 ±3.06 / 52.38 ms │  1.08x slower │
│ QQuery 27 │     515.24 / 523.51 ±7.32 / 537.04 ms │    533.46 / 544.98 ±11.25 / 562.71 ms │     no change │
│ QQuery 28 │ 2917.70 / 2943.49 ±15.82 / 2963.29 ms │ 3033.30 / 3052.79 ±14.79 / 3075.14 ms │     no change │
│ QQuery 29 │       41.26 / 55.50 ±13.21 / 76.49 ms │       41.96 / 50.93 ±10.02 / 68.86 ms │ +1.09x faster │
│ QQuery 30 │     308.06 / 312.69 ±2.81 / 315.75 ms │     326.79 / 333.20 ±5.70 / 340.16 ms │  1.07x slower │
│ QQuery 31 │     286.17 / 292.18 ±6.47 / 304.11 ms │    299.26 / 323.07 ±15.09 / 346.91 ms │  1.11x slower │
│ QQuery 32 │  945.02 / 1009.51 ±38.58 / 1061.92 ms │ 1021.14 / 1057.57 ±19.95 / 1081.27 ms │     no change │
│ QQuery 33 │ 1485.45 / 1534.51 ±32.30 / 1581.91 ms │ 1622.91 / 1667.77 ±32.50 / 1702.79 ms │  1.09x slower │
│ QQuery 34 │ 1511.38 / 1543.42 ±23.21 / 1575.47 ms │ 1647.61 / 1708.64 ±44.82 / 1770.23 ms │  1.11x slower │
│ QQuery 35 │    287.76 / 313.25 ±26.58 / 364.03 ms │    333.42 / 353.95 ±31.93 / 417.35 ms │  1.13x slower │
│ QQuery 36 │        68.09 / 78.16 ±8.90 / 89.08 ms │        69.69 / 76.42 ±4.94 / 83.93 ms │     no change │
│ QQuery 37 │        36.44 / 43.15 ±7.75 / 56.12 ms │        37.77 / 43.39 ±7.42 / 57.95 ms │     no change │
│ QQuery 38 │        43.53 / 44.69 ±0.63 / 45.40 ms │        44.73 / 49.31 ±5.55 / 60.19 ms │  1.10x slower │
│ QQuery 39 │     151.31 / 156.50 ±4.22 / 161.62 ms │    160.27 / 173.47 ±12.34 / 191.54 ms │  1.11x slower │
│ QQuery 40 │        14.80 / 16.15 ±2.07 / 20.27 ms │        15.43 / 16.66 ±1.32 / 19.07 ms │     no change │
│ QQuery 41 │        14.25 / 14.36 ±0.11 / 14.57 ms │        14.86 / 16.49 ±2.58 / 21.63 ms │  1.15x slower │
│ QQuery 42 │        13.76 / 14.08 ±0.24 / 14.44 ms │        14.48 / 14.72 ±0.23 / 15.01 ms │     no change │
└───────────┴───────────────────────────────────────┴───────────────────────────────────────┴───────────────┘
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━┓
┃ Benchmark Summary                             ┃            ┃
┡━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━┩
│ Total Time (HEAD)                             │ 19807.48ms │
│ Total Time (feat_pk-cardinality-estimation)   │ 20842.49ms │
│ Average Time (HEAD)                           │   460.64ms │
│ Average Time (feat_pk-cardinality-estimation) │   484.71ms │
│ Queries Faster                                │          2 │
│ Queries Slower                                │         17 │
│ Queries with No Change                        │         24 │
│ Queries with Failure                          │          0 │
└───────────────────────────────────────────────┴────────────┘

Resource Usage

clickbench_partitioned — base (merge-base)

Metric Value
Wall time 100.0s
Peak memory 10.7 GiB
Avg memory 4.4 GiB
CPU user 1009.2s
CPU sys 75.1s
Peak spill 0 B

clickbench_partitioned — branch

Metric Value
Wall time 105.0s
Peak memory 10.8 GiB
Avg memory 4.5 GiB
CPU user 1056.2s
CPU sys 83.8s
Peak spill 0 B

File an issue against this benchmark runner

Dandandan and others added 2 commits August 20, 2026 17:33
…row count

A declared key is treated as fact elsewhere -- an ordering requirement is
considered satisfied because of one -- so the count it implies is not a
guess. Only an unknown null count on a unique column, which may repeat NULL,
leaves it inexact.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012YiAABcW4WSqij31zz2P6c
A filter estimated an equality from the column's value range, or from the
default selectivity when the type has no range to read. Neither can say what
a unique constraint does: the column holds each value once, so an equality
matches a single row.

The distinct count a key constraint now supplies is what identifies such a
column -- one distinct value per non-null row -- so the estimate only
tightens where that count is known.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012YiAABcW4WSqij31zz2P6c
@github-actions github-actions Bot added the physical-plan Changes to the physical-plan crate label Aug 20, 2026
@Dandandan

Copy link
Copy Markdown
Contributor Author

@Rich-T-kid are you perhaps interested in reviewing this one?

@Dandandan
Dandandan force-pushed the feat/pk-cardinality-estimation branch from eb6cfa5 to d16d257 Compare August 20, 2026 18:50
@Rich-T-kid

Copy link
Copy Markdown
Contributor

Yes I'd be happy too. I may need a bit of time to catch up to speed so hopefully tonight

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

Labels

datasource Changes to the datasource crate physical-plan Changes to the physical-plan crate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Derive a distinct count from primary key and unique constraints

4 participants