From a30caf5f6c4fa3e485b6f5e7c8ad498b290d1ad4 Mon Sep 17 00:00:00 2001 From: "Lei, HUANG" Date: Tue, 14 May 2024 03:05:38 +0000 Subject: [PATCH] chore: avoid updating full primary keys --- src/mito2/src/memtable/partition_tree/dict.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/mito2/src/memtable/partition_tree/dict.rs b/src/mito2/src/memtable/partition_tree/dict.rs index 6fc0f170cf76..a7758876e160 100644 --- a/src/mito2/src/memtable/partition_tree/dict.rs +++ b/src/mito2/src/memtable/partition_tree/dict.rs @@ -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); }