summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormaksim-kita <[email protected]>2023-11-02 14:40:28 +0300
committermaksim-kita <[email protected]>2023-11-02 15:51:22 +0300
commitea7b93c5bfd5bf28a90e7deb7700ddbd3965b749 (patch)
treef8103167f710006f262b5badb76df77dfff806a4
parenta89b4966735438570b09be99b2cd1ef4dc913b86 (diff)
Schemeshard stats histrogram avoid TSerializedCellVec serialization
-rw-r--r--ydb/core/tx/schemeshard/schemeshard__table_stats_histogram.cpp12
1 files changed, 8 insertions, 4 deletions
diff --git a/ydb/core/tx/schemeshard/schemeshard__table_stats_histogram.cpp b/ydb/core/tx/schemeshard/schemeshard__table_stats_histogram.cpp
index 071f776fe7f..d736d43282d 100644
--- a/ydb/core/tx/schemeshard/schemeshard__table_stats_histogram.cpp
+++ b/ydb/core/tx/schemeshard/schemeshard__table_stats_histogram.cpp
@@ -85,7 +85,7 @@ TSerializedCellVec ChooseSplitKeyByHistogram(const NKikimrTableStats::THistogram
break;
}
- return TSerializedCellVec(TSerializedCellVec::Serialize(splitKey));
+ return TSerializedCellVec(splitKey);
}
TSerializedCellVec DoFindSplitKey(const TVector<std::pair<TSerializedCellVec, ui64>>& keysHist,
@@ -121,13 +121,17 @@ TSerializedCellVec DoFindSplitKey(const TVector<std::pair<TSerializedCellVec, ui
splitKey.resize(prefixSize);
splitKey.resize(keyColumnTypes.size());
- return TSerializedCellVec(TSerializedCellVec::Serialize(splitKey));
+
+ return TSerializedCellVec(splitKey);
}
TSerializedCellVec ChooseSplitKeyByKeySample(const NKikimrTableStats::THistogram& keySample, const TConstArrayRef<NScheme::TTypeInfo>& keyColumnTypes) {
TVector<std::pair<TSerializedCellVec, ui64>> keysHist;
- for (const auto& s : keySample.GetBuckets()) {
- keysHist.emplace_back(std::make_pair(TSerializedCellVec(s.GetKey()), s.GetValue()));
+ const auto & buckets = keySample.GetBuckets();
+ keysHist.reserve(buckets.size());
+
+ for (const auto& bucket : buckets) {
+ keysHist.emplace_back(std::make_pair(TSerializedCellVec(bucket.GetKey()), bucket.GetValue()));
}
auto fnCmp = [&keyColumnTypes] (const auto& key1, const auto& key2) {