Skip to content

Commit

Permalink
chore: avoid updating full primary keys
Browse files Browse the repository at this point in the history
  • Loading branch information
v0y4g3r committed May 14, 2024
1 parent c78e14b commit a30caf5
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/mito2/src/memtable/partition_tree/dict.rs
Original file line number Diff line number Diff line change
Expand Up @@ -131,13 +131,12 @@ impl KeyDictBuilder {
// Computes key position and then alter pk index.
let mut key_positions = vec![0; self.pk_to_index.len()];

for (i, (full_pk, (pk_index, sparse_key))) in (std::mem::take(&mut self.pk_to_index))
for (i, (_full_pk, (pk_index, sparse_key))) in (std::mem::take(&mut self.pk_to_index))
.into_iter()
.enumerate()
{
// The position of the i-th key is the old pk index.
key_positions[i] = pk_index;
pk_to_index_map.insert(full_pk, i as PkIndex);
if let Some(sparse_key) = sparse_key {
pk_to_index_map.insert(sparse_key, i as PkIndex);
}
Expand Down

0 comments on commit a30caf5

Please sign in to comment.