Repository navigation
Commit ad83fcb
committed
Cache immutable whole-subtree support checks for sparse V2 scans
Sparse identity scans must validate complete list element and dictionary
value subtrees, even when the selected root rows touch few chunks. Repeating
these checks on each scan made the 64 KiB list layout disproportionately
expensive. Cache only whole-subtree answers within ScanFile preparation;
selection-dependent answers remain uncached. Retain keyed layout Arcs to
prevent address reuse, and bypass the cache when the root layout changes.
The prior 32 MiB estimated list-work admission cap and independently
scheduled projection pieces are unchanged. No segment data is retained by
this metadata cache. Errors are not cached; unsupported answers are.
On warm local disk, 100 selected rows, three seeds, two alternating rounds
of 64 queries (discard eight), full Arrow decode/drop:
- 64 KiB clustered cached, 30 cores: 0.2053 -> 0.1525 ms (-25.7%).
- 64 KiB clustered cached, one core: 0.2716 -> 0.2220 ms (-18.3%).
- 64 KiB uniform cached, 30 cores: 0.8233 -> 0.7558 ms (-8.2%).
- No aggregate regression above 3% across 48 cases versus previous V2.
- Twelve longer reruns used four rounds of 128 queries, discard sixteen;
the largest confirmed slowdown was 2.6% (nested structs, one core).
This does not resolve all V1 gaps: 13/48 initial cases remain above +5%,
including reopened clustered lists and parallel uniform feature vectors.
Reopening receives little benefit because the preparation cache is fresh.
Experiments with smaller clustered split targets and a direct contiguous
list-element source did not improve end-to-end timing and were discarded.
Validation: 207 targeted scan::v2 unit tests; 60 real-file Arrow comparisons
against V1 full-scan-plus-take across empty, singleton, clustered, sparse,
and all-row selections at one and 30 cores; pinned rustfmt; diff --check.
No workspace-wide checks were run. Local experiment reports and rejected
patches are under the list-layout-experiment directory in the scan bench
workspace; the CI branch runs the comparable matrix on a dedicated runner.
Signed-off-by: Joe Isaacs <joe.isaacs@live.co.uk>1 parent 024005e commit ad83fcb
2 files changed
Lines changed: 113 additions & 11 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
| 35 | + | |
35 | 36 | | |
36 | 37 | | |
37 | 38 | | |
| |||
43 | 44 | | |
44 | 45 | | |
45 | 46 | | |
| 47 | + | |
46 | 48 | | |
47 | 49 | | |
48 | 50 | | |
| |||
103 | 105 | | |
104 | 106 | | |
105 | 107 | | |
| 108 | + | |
106 | 109 | | |
107 | 110 | | |
108 | 111 | | |
109 | 112 | | |
110 | 113 | | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
111 | 117 | | |
112 | 118 | | |
113 | 119 | | |
| |||
123 | 129 | | |
124 | 130 | | |
125 | 131 | | |
126 | | - | |
127 | | - | |
128 | | - | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
129 | 135 | | |
130 | 136 | | |
131 | 137 | | |
| |||
138 | 144 | | |
139 | 145 | | |
140 | 146 | | |
| 147 | + | |
141 | 148 | | |
142 | 149 | | |
143 | 150 | | |
| |||
182 | 189 | | |
183 | 190 | | |
184 | 191 | | |
185 | | - | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
186 | 199 | | |
187 | 200 | | |
188 | 201 | | |
| |||
327 | 340 | | |
328 | 341 | | |
329 | 342 | | |
| 343 | + | |
330 | 344 | | |
331 | 345 | | |
332 | 346 | | |
| |||
346 | 360 | | |
347 | 361 | | |
348 | 362 | | |
349 | | - | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
350 | 369 | | |
351 | 370 | | |
352 | 371 | | |
| |||
355 | 374 | | |
356 | 375 | | |
357 | 376 | | |
358 | | - | |
| 377 | + | |
359 | 378 | | |
360 | 379 | | |
361 | 380 | | |
| |||
366 | 385 | | |
367 | 386 | | |
368 | 387 | | |
369 | | - | |
370 | | - | |
371 | | - | |
| 388 | + | |
| 389 | + | |
372 | 390 | | |
373 | 391 | | |
374 | | - | |
| 392 | + | |
375 | 393 | | |
376 | 394 | | |
377 | 395 | | |
378 | | - | |
| 396 | + | |
379 | 397 | | |
380 | 398 | | |
381 | 399 | | |
| |||
384 | 402 | | |
385 | 403 | | |
386 | 404 | | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
387 | 419 | | |
388 | 420 | | |
389 | 421 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
59 | 59 | | |
60 | 60 | | |
61 | 61 | | |
| 62 | + | |
62 | 63 | | |
63 | 64 | | |
64 | 65 | | |
| |||
488 | 489 | | |
489 | 490 | | |
490 | 491 | | |
| 492 | + | |
| 493 | + | |
| 494 | + | |
| 495 | + | |
| 496 | + | |
| 497 | + | |
| 498 | + | |
| 499 | + | |
| 500 | + | |
| 501 | + | |
| 502 | + | |
| 503 | + | |
| 504 | + | |
| 505 | + | |
| 506 | + | |
| 507 | + | |
| 508 | + | |
| 509 | + | |
| 510 | + | |
| 511 | + | |
| 512 | + | |
| 513 | + | |
| 514 | + | |
| 515 | + | |
| 516 | + | |
| 517 | + | |
| 518 | + | |
| 519 | + | |
| 520 | + | |
| 521 | + | |
| 522 | + | |
| 523 | + | |
| 524 | + | |
| 525 | + | |
| 526 | + | |
| 527 | + | |
| 528 | + | |
| 529 | + | |
| 530 | + | |
| 531 | + | |
| 532 | + | |
| 533 | + | |
| 534 | + | |
| 535 | + | |
| 536 | + | |
| 537 | + | |
| 538 | + | |
| 539 | + | |
| 540 | + | |
| 541 | + | |
| 542 | + | |
| 543 | + | |
| 544 | + | |
| 545 | + | |
| 546 | + | |
| 547 | + | |
| 548 | + | |
| 549 | + | |
| 550 | + | |
| 551 | + | |
| 552 | + | |
| 553 | + | |
| 554 | + | |
| 555 | + | |
| 556 | + | |
| 557 | + | |
| 558 | + | |
| 559 | + | |
| 560 | + | |
491 | 561 | | |
492 | 562 | | |
493 | 563 | | |
| |||
0 commit comments