Skip to content

Commit 13209a6

Browse files
authored
use proper compaction policy for SA tables (#5437)
1 parent a7dfe79 commit 13209a6

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

ydb/core/statistics/aggregator/tx_init_schema.cpp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,17 @@ struct TStatisticsAggregator::TTxInitSchema : public TTxBase {
1414

1515
NIceDb::TNiceDb(txc.DB).Materialize<Schema>();
1616

17+
static constexpr NIceDb::TTableId bigTableIds[] = {
18+
Schema::BaseStats::TableId,
19+
};
20+
21+
for (auto id : bigTableIds) {
22+
const auto* tableInfo = txc.DB.GetScheme().GetTableInfo(id);
23+
if (!tableInfo || !tableInfo->CompactionPolicy) {
24+
txc.DB.Alter().SetCompactionPolicy(id, *NLocalDb::CreateDefaultUserTablePolicy());
25+
}
26+
}
27+
1728
return true;
1829
}
1930

0 commit comments

Comments
 (0)