Skip to content

Commit 5e3e08e

Browse files
zzylolclaude
andcommitted
fix: integrate with #621: size UnivMon state without the deleted legacy search
#621's Stage 4 sizing called pass1::replacement::sketch_state_bytes, which this PR deletes; compute UnivMon's per-layer counter and heap bytes in plan-selection directly. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1 parent 4abbff9 commit 5e3e08e

1 file changed

Lines changed: 13 additions & 2 deletions

File tree

  • crates/plan-selection/src

‎crates/plan-selection/src/lib.rs‎

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2072,9 +2072,20 @@ fn summary_shape(family: &FieldDataType) -> (u64, u64) {
20722072
),
20732073
// An insert reaches about two layers; each updates `d` rows'
20742074
// counters and sign-checks, then its heap.
2075-
params @ SketchParams::UnivMon { sketch_rows, .. } => (
2075+
// Each layer holds `rows x cols` eight-byte counters plus a
2076+
// conservative 64 bytes per heap entry.
2077+
SketchParams::UnivMon {
2078+
heap_size,
2079+
sketch_rows,
2080+
sketch_cols,
2081+
layers,
2082+
} => (
20762083
2 * (2 * u64::from(*sketch_rows) + 4),
2077-
asap_logical_optimizer::pass1::replacement::sketch_state_bytes(params)
2084+
u64::from(*sketch_rows)
2085+
.checked_mul(u64::from(*sketch_cols))
2086+
.and_then(|counters| counters.checked_mul(8))
2087+
.and_then(|bytes| bytes.checked_add(u64::from(*heap_size).checked_mul(64)?))
2088+
.and_then(|bytes| bytes.checked_mul(u64::from(*layers)))
20782089
.unwrap_or(u64::MAX),
20792090
),
20802091
_ => (1, 1_024),

0 commit comments

Comments
 (0)