Skip to content

[bench] Remove file prefetching from FileStream#20916

Draft
Dandandan wants to merge 4 commits intoapache:mainfrom
Dandandan:remove_prefetch
Draft

[bench] Remove file prefetching from FileStream#20916
Dandandan wants to merge 4 commits intoapache:mainfrom
Dandandan:remove_prefetch

Conversation

@Dandandan
Copy link
Contributor

Simplify the FileStream state machine by removing the mechanism that opens the next file in parallel while scanning the current one. Files are now opened sequentially (Scan -> Idle -> Open) instead of prefetching.

Which issue does this PR close?

  • Closes #.

Rationale for this change

What changes are included in this PR?

Are these changes tested?

Are there any user-facing changes?

Simplify the FileStream state machine by removing the mechanism that
opens the next file in parallel while scanning the current one. Files
are now opened sequentially (Scan -> Idle -> Open) instead of prefetching.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@Dandandan Dandandan changed the title Remove file prefetching from FileStream [bench] Remove file prefetching from FileStream Mar 12, 2026
@github-actions github-actions bot added the datasource Changes to the datasource crate label Mar 12, 2026
@Dandandan
Copy link
Contributor Author

run benchmarks

@adriangbot
Copy link

Benchmark job started for this request (job bench-c4050432820-168). Results will be posted here when complete.

@adriangbot
Copy link

Benchmark job started for this request (job bench-c4050432820-169). Results will be posted here when complete.

@adriangbot
Copy link

Benchmark job started for this request (job bench-c4050432820-170). Results will be posted here when complete.

@adriangbot
Copy link

🤖 Benchmark running (GKE) | trigger
Linux bench-c4050432820-170-fgr64 6.12.55+ #1 SMP Sun Feb 1 08:59:41 UTC 2026 aarch64 GNU/Linux
Comparing remove_prefetch (70bc7d0) to 57b275a (merge-base) diff using: tpch
Results will be posted here when complete

@adriangbot
Copy link

🤖 Benchmark running (GKE) | trigger
Linux bench-c4050432820-168-xqc2n 6.12.55+ #1 SMP Sun Feb 1 08:59:41 UTC 2026 aarch64 GNU/Linux
Comparing remove_prefetch (70bc7d0) to 57b275a (merge-base) diff using: clickbench_partitioned
Results will be posted here when complete

@adriangbot
Copy link

🤖 Benchmark running (GKE) | trigger
Linux bench-c4050432820-169-sn5f2 6.12.55+ #1 SMP Sun Feb 1 08:59:41 UTC 2026 aarch64 GNU/Linux
Comparing remove_prefetch (70bc7d0) to 57b275a (merge-base) diff using: tpcds
Results will be posted here when complete

@github-actions github-actions bot added the core Core DataFusion crate label Mar 12, 2026
This reverts commit 38fe60a.
@github-actions github-actions bot removed the core Core DataFusion crate label Mar 12, 2026
@adriangbot
Copy link

🤖 Benchmark completed (GKE) | trigger

Details

Comparing HEAD and remove_prefetch
--------------------
Benchmark tpch_sf1.json
--------------------
┏━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━┓
┃ Query     ┃                           HEAD ┃                remove_prefetch ┃        Change ┃
┡━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━┩
│ QQuery 1  │ 47.63 / 48.41 ±0.79 / 49.64 ms │ 46.74 / 47.22 ±0.66 / 48.53 ms │     no change │
│ QQuery 2  │ 26.14 / 26.40 ±0.23 / 26.75 ms │ 24.65 / 25.03 ±0.46 / 25.93 ms │ +1.05x faster │
│ QQuery 3  │ 34.66 / 35.18 ±0.27 / 35.43 ms │ 34.46 / 34.77 ±0.19 / 34.98 ms │     no change │
│ QQuery 4  │ 22.21 / 23.13 ±0.54 / 23.67 ms │ 22.84 / 23.86 ±0.87 / 24.98 ms │     no change │
│ QQuery 5  │ 53.66 / 54.72 ±1.05 / 56.42 ms │ 51.23 / 54.11 ±1.59 / 56.12 ms │     no change │
│ QQuery 6  │ 18.16 / 18.43 ±0.20 / 18.77 ms │ 18.02 / 18.55 ±0.56 / 19.55 ms │     no change │
│ QQuery 7  │ 59.01 / 60.73 ±1.32 / 62.27 ms │ 56.95 / 58.01 ±0.91 / 59.44 ms │     no change │
│ QQuery 8  │ 53.77 / 54.89 ±0.82 / 56.09 ms │ 52.94 / 53.82 ±0.75 / 55.18 ms │     no change │
│ QQuery 9  │ 59.51 / 60.34 ±1.11 / 62.49 ms │ 57.03 / 58.86 ±1.68 / 60.97 ms │     no change │
│ QQuery 10 │ 74.50 / 75.83 ±0.80 / 76.83 ms │ 74.30 / 74.90 ±0.69 / 75.96 ms │     no change │
│ QQuery 11 │ 18.00 / 18.65 ±0.89 / 20.41 ms │ 17.00 / 17.66 ±0.62 / 18.50 ms │ +1.06x faster │
│ QQuery 12 │ 29.73 / 30.20 ±0.39 / 30.84 ms │ 29.63 / 29.97 ±0.34 / 30.53 ms │     no change │
│ QQuery 13 │ 41.05 / 41.35 ±0.26 / 41.74 ms │ 40.30 / 41.26 ±0.98 / 43.09 ms │     no change │
│ QQuery 14 │ 30.28 / 30.52 ±0.23 / 30.85 ms │ 29.40 / 29.62 ±0.18 / 29.92 ms │     no change │
│ QQuery 15 │ 36.92 / 37.34 ±0.33 / 37.87 ms │ 36.81 / 37.36 ±0.56 / 38.38 ms │     no change │
│ QQuery 16 │ 18.38 / 18.99 ±0.54 / 19.80 ms │ 17.72 / 18.11 ±0.28 / 18.60 ms │     no change │
│ QQuery 17 │ 78.77 / 80.72 ±1.51 / 83.12 ms │ 75.36 / 77.98 ±2.29 / 81.08 ms │     no change │
│ QQuery 18 │ 82.62 / 84.34 ±1.49 / 86.78 ms │ 82.10 / 83.46 ±1.07 / 84.75 ms │     no change │
│ QQuery 19 │ 39.95 / 41.55 ±1.13 / 42.85 ms │ 38.74 / 39.77 ±1.42 / 42.58 ms │     no change │
│ QQuery 20 │ 45.38 / 46.94 ±1.10 / 48.02 ms │ 43.16 / 44.38 ±0.98 / 45.49 ms │ +1.06x faster │
│ QQuery 21 │ 74.85 / 76.81 ±2.46 / 81.62 ms │ 70.51 / 74.36 ±2.61 / 78.36 ms │     no change │
│ QQuery 22 │ 21.38 / 22.30 ±0.82 / 23.79 ms │ 19.72 / 20.20 ±0.49 / 21.12 ms │ +1.10x faster │
└───────────┴────────────────────────────────┴────────────────────────────────┴───────────────┘
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━┓
┃ Benchmark Summary              ┃          ┃
┡━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━┩
│ Total Time (HEAD)              │ 987.77ms │
│ Total Time (remove_prefetch)   │ 963.25ms │
│ Average Time (HEAD)            │  44.90ms │
│ Average Time (remove_prefetch) │  43.78ms │
│ Queries Faster                 │        4 │
│ Queries Slower                 │        0 │
│ Queries with No Change         │       18 │
│ Queries with Failure           │        0 │
└────────────────────────────────┴──────────┘

Resource Usage

tpch — base (merge-base)

Metric Value
Wall time 5.3s
Peak memory 3.9 GiB
Avg memory 3.5 GiB
CPU user 35.1s
CPU sys 3.4s
Disk read 0 B
Disk write 140.0 KiB

tpch — branch

Metric Value
Wall time 5.1s
Peak memory 4.0 GiB
Avg memory 3.5 GiB
CPU user 34.4s
CPU sys 3.3s
Disk read 0 B
Disk write 68.0 KiB

@adriangbot
Copy link

🤖 Benchmark completed (GKE) | trigger

Details

Comparing HEAD and remove_prefetch
--------------------
Benchmark clickbench_partitioned.json
--------------------
┏━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━┓
┃ Query     ┃                                  HEAD ┃                       remove_prefetch ┃        Change ┃
┡━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━┩
│ QQuery 0  │          1.56 / 4.89 ±6.48 / 17.86 ms │          1.58 / 4.87 ±6.46 / 17.78 ms │     no change │
│ QQuery 1  │        15.04 / 15.41 ±0.34 / 16.00 ms │        15.39 / 15.68 ±0.16 / 15.85 ms │     no change │
│ QQuery 2  │        56.99 / 57.35 ±0.30 / 57.72 ms │        57.80 / 58.23 ±0.24 / 58.50 ms │     no change │
│ QQuery 3  │        49.37 / 51.69 ±1.84 / 54.33 ms │        49.57 / 51.45 ±1.00 / 52.43 ms │     no change │
│ QQuery 4  │     311.41 / 313.95 ±2.10 / 316.96 ms │     311.67 / 319.43 ±7.87 / 334.43 ms │     no change │
│ QQuery 5  │     358.08 / 359.77 ±1.16 / 361.25 ms │     356.46 / 360.69 ±2.28 / 363.11 ms │     no change │
│ QQuery 6  │           5.28 / 6.02 ±0.52 / 6.52 ms │           5.38 / 5.90 ±0.54 / 6.86 ms │     no change │
│ QQuery 7  │        17.38 / 17.59 ±0.20 / 17.95 ms │        17.88 / 18.61 ±0.56 / 19.27 ms │  1.06x slower │
│ QQuery 8  │    453.34 / 463.44 ±11.07 / 482.86 ms │     447.20 / 452.07 ±3.84 / 456.23 ms │     no change │
│ QQuery 9  │     688.59 / 703.51 ±8.81 / 712.89 ms │     691.69 / 697.84 ±6.04 / 708.12 ms │     no change │
│ QQuery 10 │       92.48 / 96.51 ±2.75 / 100.60 ms │       96.51 / 98.96 ±2.75 / 104.12 ms │     no change │
│ QQuery 11 │     106.37 / 108.25 ±1.13 / 109.37 ms │     110.28 / 112.46 ±1.79 / 115.24 ms │     no change │
│ QQuery 12 │     354.99 / 357.32 ±2.05 / 360.86 ms │     351.05 / 358.58 ±4.41 / 364.27 ms │     no change │
│ QQuery 13 │     471.58 / 475.12 ±3.46 / 481.33 ms │     480.65 / 487.12 ±4.17 / 492.20 ms │     no change │
│ QQuery 14 │     361.09 / 367.63 ±5.56 / 373.81 ms │     364.27 / 371.21 ±3.80 / 375.22 ms │     no change │
│ QQuery 15 │    376.35 / 390.71 ±14.41 / 415.07 ms │    390.30 / 414.74 ±20.78 / 447.61 ms │  1.06x slower │
│ QQuery 16 │    754.10 / 788.09 ±31.65 / 831.92 ms │    755.05 / 783.62 ±36.08 / 853.84 ms │     no change │
│ QQuery 17 │     743.81 / 754.92 ±7.89 / 765.01 ms │     752.21 / 763.04 ±6.60 / 771.84 ms │     no change │
│ QQuery 18 │ 1515.94 / 1535.69 ±19.15 / 1566.24 ms │ 1450.83 / 1555.30 ±62.17 / 1629.20 ms │     no change │
│ QQuery 19 │      36.65 / 62.87 ±30.55 / 103.89 ms │        37.10 / 37.97 ±0.72 / 39.20 ms │ +1.66x faster │
│ QQuery 20 │    716.08 / 743.34 ±25.50 / 782.06 ms │    718.24 / 728.56 ±14.04 / 756.21 ms │     no change │
│ QQuery 21 │     760.86 / 768.71 ±5.35 / 775.82 ms │     762.44 / 766.00 ±3.08 / 770.31 ms │     no change │
│ QQuery 22 │  1129.94 / 1136.80 ±7.32 / 1150.10 ms │  1130.23 / 1132.90 ±1.85 / 1134.91 ms │     no change │
│ QQuery 23 │ 3181.58 / 3207.70 ±18.69 / 3237.53 ms │  3111.37 / 3119.08 ±8.32 / 3134.98 ms │     no change │
│ QQuery 24 │      99.07 / 104.48 ±4.14 / 110.86 ms │     101.81 / 104.82 ±3.81 / 112.05 ms │     no change │
│ QQuery 25 │     139.99 / 144.04 ±2.07 / 145.65 ms │     140.60 / 142.64 ±1.55 / 145.04 ms │     no change │
│ QQuery 26 │     104.29 / 105.34 ±1.02 / 106.81 ms │     103.45 / 106.14 ±1.82 / 108.63 ms │     no change │
│ QQuery 27 │     850.25 / 859.64 ±6.34 / 869.75 ms │     855.67 / 858.43 ±2.57 / 861.87 ms │     no change │
│ QQuery 28 │ 7728.91 / 7780.90 ±42.67 / 7845.96 ms │ 7746.89 / 7782.02 ±21.10 / 7806.54 ms │     no change │
│ QQuery 29 │     331.63 / 335.62 ±6.92 / 349.44 ms │     332.05 / 337.84 ±9.76 / 357.33 ms │     no change │
│ QQuery 30 │    374.95 / 385.00 ±10.90 / 405.61 ms │     371.27 / 381.56 ±7.62 / 390.95 ms │     no change │
│ QQuery 31 │     379.61 / 392.95 ±9.96 / 410.36 ms │    374.86 / 388.67 ±12.85 / 411.48 ms │     no change │
│ QQuery 32 │ 1089.46 / 1107.08 ±21.09 / 1148.01 ms │ 1076.32 / 1108.73 ±24.99 / 1152.89 ms │     no change │
│ QQuery 33 │ 1522.09 / 1531.88 ±10.93 / 1548.16 ms │ 1515.12 / 1532.60 ±12.80 / 1547.00 ms │     no change │
│ QQuery 34 │ 1503.73 / 1518.36 ±15.57 / 1548.42 ms │ 1569.49 / 1635.79 ±43.89 / 1690.21 ms │  1.08x slower │
│ QQuery 35 │     410.92 / 417.68 ±5.67 / 427.93 ms │    450.48 / 471.07 ±14.12 / 486.86 ms │  1.13x slower │
│ QQuery 36 │     115.52 / 125.70 ±5.77 / 133.31 ms │     117.49 / 126.25 ±4.65 / 130.09 ms │     no change │
│ QQuery 37 │        50.42 / 51.44 ±1.20 / 53.69 ms │        51.32 / 52.56 ±0.79 / 53.81 ms │     no change │
│ QQuery 38 │        77.50 / 78.84 ±0.91 / 80.27 ms │        77.68 / 81.15 ±2.75 / 85.18 ms │     no change │
│ QQuery 39 │     223.06 / 233.12 ±6.98 / 242.35 ms │     222.27 / 235.35 ±7.54 / 242.25 ms │     no change │
│ QQuery 40 │        26.59 / 27.77 ±0.68 / 28.37 ms │        27.03 / 28.99 ±1.90 / 32.08 ms │     no change │
│ QQuery 41 │        21.39 / 22.88 ±0.79 / 23.63 ms │        21.65 / 22.29 ±0.50 / 23.09 ms │     no change │
│ QQuery 42 │        21.24 / 22.09 ±0.60 / 22.69 ms │        21.21 / 21.71 ±0.27 / 21.98 ms │     no change │
└───────────┴───────────────────────────────────────┴───────────────────────────────────────┴───────────────┘
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━┓
┃ Benchmark Summary              ┃            ┃
┡━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━┩
│ Total Time (HEAD)              │ 28032.06ms │
│ Total Time (remove_prefetch)   │ 28132.92ms │
│ Average Time (HEAD)            │   651.91ms │
│ Average Time (remove_prefetch) │   654.25ms │
│ Queries Faster                 │          1 │
│ Queries Slower                 │          4 │
│ Queries with No Change         │         38 │
│ Queries with Failure           │          0 │
└────────────────────────────────┴────────────┘

Resource Usage

clickbench_partitioned — base (merge-base)

Metric Value
Wall time 141.4s
Peak memory 42.9 GiB
Avg memory 31.8 GiB
CPU user 1327.7s
CPU sys 89.0s
Disk read 0 B
Disk write 4.0 GiB

clickbench_partitioned — branch

Metric Value
Wall time 141.5s
Peak memory 39.8 GiB
Avg memory 32.2 GiB
CPU user 1328.8s
CPU sys 98.2s
Disk read 0 B
Disk write 608.0 KiB

@adriangbot
Copy link

🤖 Benchmark completed (GKE) | trigger

Details

Comparing HEAD and remove_prefetch
--------------------
Benchmark tpcds_sf1.json
--------------------
┏━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━┓
┃ Query     ┃                                     HEAD ┃                          remove_prefetch ┃    Change ┃
┡━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━┩
│ QQuery 1  │           50.31 / 50.97 ±0.46 / 51.76 ms │           50.26 / 51.14 ±0.64 / 51.90 ms │ no change │
│ QQuery 2  │        155.41 / 155.68 ±0.32 / 156.25 ms │        154.08 / 154.87 ±0.46 / 155.40 ms │ no change │
│ QQuery 3  │        120.29 / 121.51 ±0.65 / 122.15 ms │        119.61 / 120.30 ±0.53 / 121.24 ms │ no change │
│ QQuery 4  │    1449.85 / 1472.40 ±12.83 / 1484.86 ms │    1438.16 / 1463.14 ±16.87 / 1481.93 ms │ no change │
│ QQuery 5  │        186.69 / 187.85 ±1.14 / 189.86 ms │        186.49 / 187.20 ±0.88 / 188.93 ms │ no change │
│ QQuery 6  │     1073.36 / 1083.22 ±7.53 / 1092.84 ms │    1024.31 / 1045.61 ±13.53 / 1064.04 ms │ no change │
│ QQuery 7  │        362.31 / 366.34 ±3.97 / 373.61 ms │        363.73 / 366.98 ±3.83 / 374.24 ms │ no change │
│ QQuery 8  │        124.93 / 125.31 ±0.43 / 126.11 ms │        124.03 / 124.97 ±1.15 / 127.15 ms │ no change │
│ QQuery 9  │        113.35 / 116.24 ±2.36 / 119.06 ms │        107.39 / 114.73 ±4.03 / 118.45 ms │ no change │
│ QQuery 10 │        115.40 / 115.98 ±0.59 / 116.79 ms │        114.47 / 116.20 ±0.97 / 117.00 ms │ no change │
│ QQuery 11 │     1030.73 / 1040.00 ±5.27 / 1046.49 ms │     1021.22 / 1032.65 ±8.92 / 1045.83 ms │ no change │
│ QQuery 12 │           48.43 / 49.86 ±1.07 / 51.47 ms │           48.60 / 50.52 ±1.68 / 53.57 ms │ no change │
│ QQuery 13 │        415.57 / 421.64 ±5.35 / 430.69 ms │        413.63 / 415.08 ±1.39 / 417.09 ms │ no change │
│ QQuery 14 │     1094.06 / 1103.64 ±6.10 / 1110.71 ms │     1095.79 / 1098.09 ±2.25 / 1101.78 ms │ no change │
│ QQuery 15 │           17.91 / 18.80 ±0.85 / 20.35 ms │           18.87 / 19.42 ±0.60 / 20.20 ms │ no change │
│ QQuery 16 │           46.01 / 47.36 ±1.07 / 48.64 ms │           46.30 / 46.87 ±0.53 / 47.79 ms │ no change │
│ QQuery 17 │        257.06 / 258.02 ±0.65 / 258.75 ms │        253.12 / 255.15 ±1.37 / 256.96 ms │ no change │
│ QQuery 18 │        135.32 / 136.67 ±0.97 / 138.05 ms │        133.14 / 135.49 ±1.74 / 137.79 ms │ no change │
│ QQuery 19 │        166.79 / 168.43 ±0.88 / 169.43 ms │        165.46 / 166.33 ±1.24 / 168.77 ms │ no change │
│ QQuery 20 │           16.19 / 16.67 ±0.50 / 17.55 ms │           16.24 / 17.25 ±0.51 / 17.55 ms │ no change │
│ QQuery 21 │           24.41 / 24.72 ±0.35 / 25.27 ms │           23.95 / 24.85 ±0.63 / 25.68 ms │ no change │
│ QQuery 22 │        528.92 / 533.24 ±4.12 / 540.85 ms │       529.92 / 537.36 ±11.47 / 560.20 ms │ no change │
│ QQuery 23 │       981.75 / 995.79 ±9.36 / 1009.24 ms │       986.27 / 993.12 ±6.78 / 1005.06 ms │ no change │
│ QQuery 24 │        446.50 / 448.15 ±1.98 / 451.90 ms │        443.31 / 444.47 ±0.80 / 445.45 ms │ no change │
│ QQuery 25 │        373.47 / 375.79 ±1.60 / 377.87 ms │        369.62 / 371.94 ±1.48 / 374.23 ms │ no change │
│ QQuery 26 │           85.38 / 87.18 ±1.13 / 88.72 ms │           86.93 / 88.53 ±1.70 / 91.10 ms │ no change │
│ QQuery 27 │        359.42 / 361.96 ±1.62 / 364.49 ms │        358.28 / 359.72 ±1.52 / 361.70 ms │ no change │
│ QQuery 28 │        156.87 / 157.75 ±0.73 / 158.97 ms │        155.31 / 156.62 ±1.31 / 159.06 ms │ no change │
│ QQuery 29 │        312.30 / 315.84 ±2.42 / 319.73 ms │        312.92 / 315.27 ±1.34 / 316.64 ms │ no change │
│ QQuery 30 │           49.68 / 51.96 ±1.73 / 54.15 ms │           48.65 / 51.66 ±2.18 / 55.25 ms │ no change │
│ QQuery 31 │        187.04 / 187.77 ±0.74 / 189.07 ms │        184.46 / 186.13 ±1.06 / 187.54 ms │ no change │
│ QQuery 32 │           62.55 / 63.96 ±1.80 / 67.49 ms │           63.08 / 63.41 ±0.35 / 63.88 ms │ no change │
│ QQuery 33 │        151.93 / 154.56 ±1.54 / 155.90 ms │        150.31 / 152.11 ±1.15 / 153.78 ms │ no change │
│ QQuery 34 │        111.70 / 113.57 ±1.12 / 115.10 ms │        112.01 / 112.76 ±0.57 / 113.68 ms │ no change │
│ QQuery 35 │        117.93 / 120.45 ±1.29 / 121.53 ms │        119.81 / 120.66 ±0.57 / 121.50 ms │ no change │
│ QQuery 36 │        225.13 / 230.46 ±3.14 / 233.77 ms │        225.52 / 231.40 ±3.03 / 233.86 ms │ no change │
│ QQuery 37 │        192.94 / 194.75 ±1.63 / 197.12 ms │        191.33 / 192.52 ±1.43 / 195.09 ms │ no change │
│ QQuery 38 │           95.23 / 96.16 ±0.92 / 97.64 ms │          92.64 / 96.29 ±3.24 / 101.80 ms │ no change │
│ QQuery 39 │        139.12 / 143.17 ±2.54 / 146.88 ms │        141.37 / 142.88 ±1.34 / 145.18 ms │ no change │
│ QQuery 40 │        117.67 / 125.20 ±4.76 / 132.29 ms │        123.16 / 127.40 ±3.81 / 134.55 ms │ no change │
│ QQuery 41 │           18.26 / 19.75 ±1.09 / 21.29 ms │           18.28 / 19.43 ±1.22 / 21.60 ms │ no change │
│ QQuery 42 │        113.19 / 114.32 ±0.93 / 115.78 ms │        114.69 / 116.11 ±0.75 / 116.83 ms │ no change │
│ QQuery 43 │           90.37 / 91.11 ±0.52 / 91.72 ms │           91.08 / 91.88 ±0.42 / 92.30 ms │ no change │
│ QQuery 44 │           17.51 / 18.07 ±0.36 / 18.52 ms │           17.63 / 18.15 ±0.33 / 18.61 ms │ no change │
│ QQuery 45 │           56.79 / 58.33 ±0.93 / 59.58 ms │           57.64 / 58.20 ±0.70 / 59.57 ms │ no change │
│ QQuery 46 │        245.19 / 248.23 ±2.00 / 250.80 ms │        248.16 / 251.12 ±1.55 / 252.67 ms │ no change │
│ QQuery 47 │        795.42 / 802.85 ±4.59 / 807.84 ms │        796.51 / 806.68 ±5.79 / 813.99 ms │ no change │
│ QQuery 48 │        297.34 / 299.99 ±2.08 / 303.53 ms │        298.15 / 304.06 ±4.63 / 311.89 ms │ no change │
│ QQuery 49 │        265.50 / 268.14 ±2.49 / 272.47 ms │        264.54 / 267.32 ±1.81 / 270.20 ms │ no change │
│ QQuery 50 │        244.29 / 250.81 ±4.15 / 256.73 ms │        242.75 / 250.02 ±3.91 / 253.69 ms │ no change │
│ QQuery 51 │        193.47 / 196.96 ±2.20 / 199.64 ms │        196.01 / 197.47 ±0.98 / 198.78 ms │ no change │
│ QQuery 52 │        113.83 / 114.96 ±1.17 / 116.50 ms │        113.29 / 115.15 ±1.36 / 117.25 ms │ no change │
│ QQuery 53 │        109.69 / 111.35 ±1.62 / 113.80 ms │        109.20 / 110.26 ±0.74 / 111.23 ms │ no change │
│ QQuery 54 │        156.12 / 157.95 ±1.16 / 159.79 ms │        158.40 / 159.55 ±0.87 / 160.77 ms │ no change │
│ QQuery 55 │        111.91 / 113.48 ±1.05 / 115.22 ms │        111.68 / 112.73 ±0.68 / 113.64 ms │ no change │
│ QQuery 56 │        153.37 / 155.15 ±1.84 / 158.40 ms │        152.80 / 154.11 ±1.16 / 156.13 ms │ no change │
│ QQuery 57 │        191.66 / 193.09 ±1.16 / 194.49 ms │        188.64 / 192.15 ±2.64 / 196.40 ms │ no change │
│ QQuery 58 │        311.03 / 317.66 ±5.94 / 325.89 ms │       306.95 / 319.20 ±12.87 / 341.59 ms │ no change │
│ QQuery 59 │        212.62 / 215.27 ±2.47 / 219.45 ms │        210.16 / 211.43 ±1.25 / 213.66 ms │ no change │
│ QQuery 60 │        156.02 / 157.21 ±1.60 / 160.15 ms │        154.01 / 155.53 ±1.22 / 157.67 ms │ no change │
│ QQuery 61 │        185.80 / 188.48 ±2.19 / 191.43 ms │        183.37 / 186.03 ±1.53 / 187.87 ms │ no change │
│ QQuery 62 │       936.57 / 971.23 ±27.28 / 998.73 ms │       920.73 / 934.61 ±15.62 / 964.80 ms │ no change │
│ QQuery 63 │        111.20 / 113.90 ±2.08 / 115.99 ms │        109.50 / 112.70 ±3.97 / 120.24 ms │ no change │
│ QQuery 64 │        735.91 / 740.26 ±3.44 / 744.43 ms │        729.37 / 734.78 ±3.81 / 739.93 ms │ no change │
│ QQuery 65 │        274.95 / 277.39 ±2.90 / 282.81 ms │        275.80 / 277.78 ±1.81 / 280.23 ms │ no change │
│ QQuery 66 │        248.76 / 262.56 ±9.14 / 274.64 ms │        256.15 / 260.65 ±3.40 / 265.71 ms │ no change │
│ QQuery 67 │        357.12 / 363.63 ±5.58 / 371.16 ms │        349.89 / 358.73 ±5.11 / 365.37 ms │ no change │
│ QQuery 68 │        297.91 / 301.35 ±4.29 / 309.81 ms │        297.28 / 300.25 ±2.39 / 304.04 ms │ no change │
│ QQuery 69 │        113.63 / 115.55 ±1.56 / 117.86 ms │        114.22 / 116.29 ±2.22 / 120.34 ms │ no change │
│ QQuery 70 │        357.93 / 367.26 ±7.95 / 380.91 ms │        343.26 / 359.42 ±8.55 / 368.79 ms │ no change │
│ QQuery 71 │        145.01 / 145.99 ±1.25 / 148.35 ms │        140.51 / 143.49 ±1.51 / 144.71 ms │ no change │
│ QQuery 72 │       742.22 / 754.07 ±11.76 / 773.75 ms │        738.53 / 755.76 ±8.99 / 763.84 ms │ no change │
│ QQuery 73 │        108.53 / 111.40 ±1.83 / 114.06 ms │        109.42 / 110.35 ±0.88 / 111.84 ms │ no change │
│ QQuery 74 │        655.78 / 662.11 ±4.86 / 669.71 ms │        653.33 / 659.19 ±4.84 / 667.18 ms │ no change │
│ QQuery 75 │        297.06 / 299.35 ±1.78 / 301.84 ms │        294.27 / 296.13 ±2.00 / 299.70 ms │ no change │
│ QQuery 76 │        139.93 / 141.62 ±0.93 / 142.55 ms │        139.94 / 141.11 ±1.25 / 143.05 ms │ no change │
│ QQuery 77 │        205.20 / 206.98 ±1.79 / 210.26 ms │        205.45 / 207.84 ±1.93 / 210.01 ms │ no change │
│ QQuery 78 │        374.50 / 375.48 ±0.82 / 376.52 ms │        364.97 / 371.30 ±3.45 / 375.06 ms │ no change │
│ QQuery 79 │        249.74 / 252.21 ±3.06 / 258.12 ms │        247.67 / 252.00 ±3.15 / 255.74 ms │ no change │
│ QQuery 80 │        345.41 / 349.45 ±2.76 / 352.94 ms │        342.27 / 346.05 ±2.80 / 350.84 ms │ no change │
│ QQuery 81 │           31.89 / 32.45 ±0.72 / 33.83 ms │           31.41 / 32.52 ±1.00 / 34.21 ms │ no change │
│ QQuery 82 │        210.57 / 212.24 ±2.07 / 216.18 ms │        208.03 / 211.46 ±2.26 / 215.02 ms │ no change │
│ QQuery 83 │           47.20 / 48.82 ±1.12 / 49.75 ms │           47.82 / 50.07 ±1.96 / 53.73 ms │ no change │
│ QQuery 84 │           53.38 / 54.77 ±1.42 / 57.13 ms │           52.65 / 53.57 ±0.82 / 54.78 ms │ no change │
│ QQuery 85 │        154.03 / 156.03 ±1.58 / 158.88 ms │        153.84 / 156.22 ±1.70 / 158.39 ms │ no change │
│ QQuery 86 │           42.23 / 43.27 ±0.81 / 44.28 ms │           42.47 / 43.05 ±0.67 / 43.91 ms │ no change │
│ QQuery 87 │          94.63 / 98.11 ±4.54 / 107.00 ms │          94.50 / 96.91 ±2.65 / 101.85 ms │ no change │
│ QQuery 88 │        114.85 / 115.61 ±0.50 / 116.37 ms │        113.91 / 114.97 ±0.72 / 115.85 ms │ no change │
│ QQuery 89 │        127.79 / 128.64 ±0.47 / 129.16 ms │        128.32 / 129.02 ±0.47 / 129.56 ms │ no change │
│ QQuery 90 │           29.37 / 29.88 ±0.29 / 30.25 ms │           28.73 / 29.69 ±0.86 / 31.30 ms │ no change │
│ QQuery 91 │           67.28 / 68.66 ±1.82 / 72.23 ms │           68.15 / 68.67 ±0.40 / 69.29 ms │ no change │
│ QQuery 92 │           63.94 / 64.29 ±0.28 / 64.70 ms │           63.28 / 64.67 ±1.45 / 67.32 ms │ no change │
│ QQuery 93 │        200.20 / 203.37 ±2.00 / 206.38 ms │        200.71 / 201.81 ±1.41 / 204.55 ms │ no change │
│ QQuery 94 │           68.69 / 69.36 ±0.97 / 71.28 ms │           67.21 / 67.69 ±0.45 / 68.49 ms │ no change │
│ QQuery 95 │        144.68 / 147.87 ±2.90 / 152.62 ms │        144.70 / 146.27 ±1.75 / 149.52 ms │ no change │
│ QQuery 96 │           79.87 / 81.16 ±1.09 / 83.08 ms │           77.22 / 80.51 ±1.86 / 82.90 ms │ no change │
│ QQuery 97 │        135.33 / 139.54 ±3.40 / 144.86 ms │        137.20 / 138.82 ±1.37 / 140.60 ms │ no change │
│ QQuery 98 │        157.41 / 159.68 ±1.77 / 162.78 ms │        158.35 / 159.87 ±1.32 / 161.79 ms │ no change │
│ QQuery 99 │ 10826.27 / 10871.32 ±27.52 / 10907.96 ms │ 10825.99 / 10878.61 ±38.07 / 10934.04 ms │ no change │
└───────────┴──────────────────────────────────────────┴──────────────────────────────────────────┴───────────┘
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━┓
┃ Benchmark Summary              ┃            ┃
┡━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━┩
│ Total Time (HEAD)              │ 35469.08ms │
│ Total Time (remove_prefetch)   │ 35310.53ms │
│ Average Time (HEAD)            │   358.27ms │
│ Average Time (remove_prefetch) │   356.67ms │
│ Queries Faster                 │          0 │
│ Queries Slower                 │          0 │
│ Queries with No Change         │         99 │
│ Queries with Failure           │          0 │
└────────────────────────────────┴────────────┘

Resource Usage

tpcds — base (merge-base)

Metric Value
Wall time 177.7s
Peak memory 5.6 GiB
Avg memory 4.6 GiB
CPU user 283.2s
CPU sys 21.1s
Disk read 0 B
Disk write 636.1 MiB

tpcds — branch

Metric Value
Wall time 176.9s
Peak memory 5.6 GiB
Avg memory 4.4 GiB
CPU user 281.3s
CPU sys 20.9s
Disk read 0 B
Disk write 148.0 KiB

.metrics
.clone();
let _timer = scanning_total_metric.timer();
self.start_next_file().transpose()
Copy link
Contributor Author

Choose a reason for hiding this comment

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

So this @alamb is what I was mostly talking about. It will both read the footer (what we want) but AFAIK also:

  • build the pruning predicate (I think this is suboptimal, too early)
  • prune row groups
  • optionally load the page index
  • return the stream (without driving that forward)

We should be able to do this much better with the IO / CPU separation.

Copy link
Contributor

Choose a reason for hiding this comment

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

This makes sense to me 👍🏻

@alamb-ghbot
Copy link

🤖 ./gh_compare_branch.sh gh_compare_branch.sh Running
Linux aal-dev 6.14.0-1018-gcp #19~24.04.1-Ubuntu SMP Wed Sep 24 23:23:09 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux
Comparing remove_prefetch (ba2863c) to 57b275a diff using: tpch_mem clickbench_partitioned clickbench_extended
Results will be posted here when complete

@alamb-ghbot
Copy link

🤖: Benchmark completed

Details

Comparing HEAD and remove_prefetch
--------------------
Benchmark clickbench_extended.json
--------------------
┏━━━━━━━━━━┳━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━┓
┃ Query    ┃        HEAD ┃ remove_prefetch ┃       Change ┃
┡━━━━━━━━━━╇━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━┩
│ QQuery 0 │  2312.38 ms │      2333.66 ms │    no change │
│ QQuery 1 │   865.55 ms │       910.31 ms │ 1.05x slower │
│ QQuery 2 │  1637.13 ms │      1827.34 ms │ 1.12x slower │
│ QQuery 3 │   998.37 ms │      1053.16 ms │ 1.05x slower │
│ QQuery 4 │  2190.67 ms │      2183.89 ms │    no change │
│ QQuery 5 │ 26723.95 ms │     27084.99 ms │    no change │
│ QQuery 6 │  3602.82 ms │      3898.27 ms │ 1.08x slower │
│ QQuery 7 │  2873.65 ms │      2771.68 ms │    no change │
└──────────┴─────────────┴─────────────────┴──────────────┘
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━┓
┃ Benchmark Summary              ┃            ┃
┡━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━┩
│ Total Time (HEAD)              │ 41204.52ms │
│ Total Time (remove_prefetch)   │ 42063.30ms │
│ Average Time (HEAD)            │  5150.56ms │
│ Average Time (remove_prefetch) │  5257.91ms │
│ Queries Faster                 │          0 │
│ Queries Slower                 │          4 │
│ Queries with No Change         │          4 │
│ Queries with Failure           │          0 │
└────────────────────────────────┴────────────┘
--------------------
Benchmark clickbench_partitioned.json
--------------------
┏━━━━━━━━━━━┳━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━┓
┃ Query     ┃        HEAD ┃ remove_prefetch ┃        Change ┃
┡━━━━━━━━━━━╇━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━┩
│ QQuery 0  │     2.57 ms │         2.67 ms │     no change │
│ QQuery 1  │    46.55 ms │        47.72 ms │     no change │
│ QQuery 2  │   150.47 ms │       152.99 ms │     no change │
│ QQuery 3  │   154.27 ms │       155.31 ms │     no change │
│ QQuery 4  │   971.25 ms │      1013.94 ms │     no change │
│ QQuery 5  │  1179.82 ms │      1281.79 ms │  1.09x slower │
│ QQuery 6  │     6.22 ms │         6.10 ms │     no change │
│ QQuery 7  │    52.83 ms │        52.45 ms │     no change │
│ QQuery 8  │  1343.22 ms │      1388.13 ms │     no change │
│ QQuery 9  │  1677.53 ms │      1752.61 ms │     no change │
│ QQuery 10 │   306.18 ms │       340.67 ms │  1.11x slower │
│ QQuery 11 │   353.68 ms │       376.69 ms │  1.07x slower │
│ QQuery 12 │  1114.31 ms │      1202.33 ms │  1.08x slower │
│ QQuery 13 │  1815.48 ms │      1925.39 ms │  1.06x slower │
│ QQuery 14 │  1147.34 ms │      1237.05 ms │  1.08x slower │
│ QQuery 15 │  1120.69 ms │      1245.88 ms │  1.11x slower │
│ QQuery 16 │  2310.92 ms │      2547.52 ms │  1.10x slower │
│ QQuery 17 │  2312.17 ms │      2535.81 ms │  1.10x slower │
│ QQuery 18 │  5359.85 ms │      4874.00 ms │ +1.10x faster │
│ QQuery 19 │   115.10 ms │       122.23 ms │  1.06x slower │
│ QQuery 20 │  1755.46 ms │      1843.45 ms │  1.05x slower │
│ QQuery 21 │  1952.38 ms │      2075.71 ms │  1.06x slower │
│ QQuery 22 │  3441.48 ms │      3584.14 ms │     no change │
│ QQuery 23 │ 19325.01 ms │     11321.87 ms │ +1.71x faster │
│ QQuery 24 │   180.60 ms │       170.86 ms │ +1.06x faster │
│ QQuery 25 │   411.26 ms │       423.73 ms │     no change │
│ QQuery 26 │   183.28 ms │       174.56 ms │     no change │
│ QQuery 27 │  2523.11 ms │      2620.70 ms │     no change │
│ QQuery 28 │ 23892.38 ms │     22992.31 ms │     no change │
│ QQuery 29 │   949.94 ms │       972.85 ms │     no change │
│ QQuery 30 │  1190.65 ms │      1200.17 ms │     no change │
│ QQuery 31 │  1256.26 ms │      1242.72 ms │     no change │
│ QQuery 32 │  4385.95 ms │      4454.00 ms │     no change │
│ QQuery 33 │  5332.41 ms │      5323.05 ms │     no change │
│ QQuery 34 │  6245.86 ms │      5877.98 ms │ +1.06x faster │
│ QQuery 35 │  1117.34 ms │      1106.56 ms │     no change │
│ QQuery 36 │   183.08 ms │       182.77 ms │     no change │
│ QQuery 37 │    68.71 ms │        70.99 ms │     no change │
│ QQuery 38 │   106.54 ms │       115.68 ms │  1.09x slower │
│ QQuery 39 │   344.32 ms │       334.93 ms │     no change │
│ QQuery 40 │    40.77 ms │        39.27 ms │     no change │
│ QQuery 41 │    34.68 ms │        35.08 ms │     no change │
│ QQuery 42 │    31.52 ms │        29.11 ms │ +1.08x faster │
└───────────┴─────────────┴─────────────────┴───────────────┘
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━┓
┃ Benchmark Summary              ┃            ┃
┡━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━┩
│ Total Time (HEAD)              │ 96493.46ms │
│ Total Time (remove_prefetch)   │ 88453.75ms │
│ Average Time (HEAD)            │  2244.03ms │
│ Average Time (remove_prefetch) │  2057.06ms │
│ Queries Faster                 │          5 │
│ Queries Slower                 │         13 │
│ Queries with No Change         │         25 │
│ Queries with Failure           │          0 │
└────────────────────────────────┴────────────┘
--------------------
Benchmark tpch_mem_sf1.json
--------------------
┏━━━━━━━━━━━┳━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━┓
┃ Query     ┃      HEAD ┃ remove_prefetch ┃        Change ┃
┡━━━━━━━━━━━╇━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━┩
│ QQuery 1  │ 100.79 ms │       100.69 ms │     no change │
│ QQuery 2  │  30.73 ms │        30.59 ms │     no change │
│ QQuery 3  │  38.11 ms │        38.62 ms │     no change │
│ QQuery 4  │  30.35 ms │        30.31 ms │     no change │
│ QQuery 5  │  80.35 ms │        80.73 ms │     no change │
│ QQuery 6  │  20.56 ms │        20.12 ms │     no change │
│ QQuery 7  │ 143.92 ms │       148.17 ms │     no change │
│ QQuery 8  │  39.10 ms │        40.46 ms │     no change │
│ QQuery 9  │ 101.63 ms │        96.09 ms │ +1.06x faster │
│ QQuery 10 │  66.20 ms │        63.35 ms │     no change │
│ QQuery 11 │  19.23 ms │        17.84 ms │ +1.08x faster │
│ QQuery 12 │  55.72 ms │        55.92 ms │     no change │
│ QQuery 13 │  48.23 ms │        48.71 ms │     no change │
│ QQuery 14 │  14.07 ms │        14.03 ms │     no change │
│ QQuery 15 │  29.53 ms │        29.51 ms │     no change │
│ QQuery 16 │  26.86 ms │        27.41 ms │     no change │
│ QQuery 17 │ 138.23 ms │       142.63 ms │     no change │
│ QQuery 18 │ 267.59 ms │       263.72 ms │     no change │
│ QQuery 19 │  42.80 ms │        43.50 ms │     no change │
│ QQuery 20 │  55.13 ms │        56.41 ms │     no change │
│ QQuery 21 │ 186.70 ms │       192.19 ms │     no change │
│ QQuery 22 │  22.32 ms │        22.29 ms │     no change │
└───────────┴───────────┴─────────────────┴───────────────┘
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━┓
┃ Benchmark Summary              ┃           ┃
┡━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━┩
│ Total Time (HEAD)              │ 1558.18ms │
│ Total Time (remove_prefetch)   │ 1563.29ms │
│ Average Time (HEAD)            │   70.83ms │
│ Average Time (remove_prefetch) │   71.06ms │
│ Queries Faster                 │         2 │
│ Queries Slower                 │         0 │
│ Queries with No Change         │        20 │
│ Queries with Failure           │         0 │
└────────────────────────────────┴───────────┘

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants