MCPcopy Create free account
hub / github.com/clockworklabs/SpacetimeDB / reconstruct_index_num_key_bytes

Function reconstruct_index_num_key_bytes

crates/table/src/table.rs:2586–2596  ·  view source on GitHub ↗
(table: &Table, blob_store: &dyn BlobStore, index_id: IndexId)

Source from the content-addressed store, hash-verified

2584 }
2585
2586 fn reconstruct_index_num_key_bytes(table: &Table, blob_store: &dyn BlobStore, index_id: IndexId) -> u64 {
2587 let index = table.get_index_by_id(index_id).unwrap();
2588
2589 index
2590 .iter()
2591 .map(|row_ptr| {
2592 let row_ref = table.get_row_ref(blob_store, row_ptr).unwrap();
2593 index.project_row(row_ref).key_size_in_bytes() as u64
2594 })
2595 .sum()
2596 }
2597
2598 /// Given a row type `ty`, a set of rows of that type `vals`,
2599 /// and a set of columns within that type `indexed_columns`,

Callers

nothing calls this directly

Calls 8

get_index_by_idMethod · 0.80
get_row_refMethod · 0.80
project_rowMethod · 0.80
iterMethod · 0.65
unwrapMethod · 0.45
sumMethod · 0.45
mapMethod · 0.45
key_size_in_bytesMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…