@@ -31,10 +31,11 @@ static bool IsIntegerType(NScheme::TTypeInfo type) {
31
31
}
32
32
33
33
TSerializedCellVec ChooseSplitKeyByHistogram (const NKikimrTableStats::THistogram& histogram, const TConstArrayRef<NScheme::TTypeInfo> &keyColumnTypes) {
34
+ // Note: actually its histogram keys count, not buckets count
34
35
ui64 bucketsCount = histogram.BucketsSize ();
35
- ui64 idxLo = bucketsCount * 0.33 ;
36
- ui64 idxMed = bucketsCount * 0.5 ;
37
- ui64 idxHi = bucketsCount * 0.66 ;
36
+ ui64 idxLo = bucketsCount / 3 ;
37
+ ui64 idxMed = bucketsCount / 2 ;
38
+ ui64 idxHi = bucketsCount * 2 / 3 ;
38
39
39
40
TSerializedCellVec keyLo (histogram.GetBuckets (idxLo).GetKey ());
40
41
TSerializedCellVec keyMed (histogram.GetBuckets (idxMed).GetKey ());
@@ -298,7 +299,8 @@ bool TTxPartitionHistogram::Execute(TTransactionContext& txc, const TActorContex
298
299
<< " for pathId " << tableId
299
300
<< " state '" << DatashardStateName (rec.GetShardState ()).data () << " '"
300
301
<< " dataSize " << dataSize
301
- << " rowCount " << rowCount);
302
+ << " rowCount " << rowCount
303
+ << " dataSizeHistogram buckets " << rec.GetTableStats ().GetDataSizeHistogram ().BucketsSize ());
302
304
303
305
if (!Self->Tables .contains (tableId))
304
306
return true ;
@@ -349,6 +351,7 @@ bool TTxPartitionHistogram::Execute(TTransactionContext& txc, const TActorContex
349
351
} else {
350
352
// Choose number of parts and split boundaries
351
353
const auto & histogram = rec.GetTableStats ().GetDataSizeHistogram ();
354
+ // TODO: split with 1 key in histogram when no FlatIndex
352
355
if (histogram.BucketsSize () < 2 ) {
353
356
return true ;
354
357
}
0 commit comments