Skip to content

Commit

Permalink
Added metadata flag to track if stats for optimizer were loaded (#7188)
Browse files Browse the repository at this point in the history
  • Loading branch information
pavelvelikhov authored Jul 29, 2024
1 parent 9908fdd commit c1bd94c
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions ydb/core/kqp/gateway/kqp_metadata_loader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -891,6 +891,7 @@ NThreading::TFuture<TTableMetadataResult> TKqpTableMetadataLoader::LoadTableMeta
auto s = std::get<NKikimr::NStat::TStatSimple>(resp.Statistics);
result.Metadata->RecordsCount = s.RowCount;
result.Metadata->DataSize = s.BytesSize;
result.Metadata->StatsLoaded = true;
}
promise.SetValue(result);
});
Expand Down
3 changes: 3 additions & 0 deletions ydb/core/kqp/provider/yql_kikimr_gateway.h
Original file line number Diff line number Diff line change
Expand Up @@ -416,6 +416,7 @@ struct TKikimrTableMetadata : public TThrRefBase {
ui64 DataSize = 0;
ui64 MemorySize = 0;
ui32 ShardsCount = 0;
bool StatsLoaded = false;

TInstant LastAccessTime;
TInstant LastUpdateTime;
Expand Down Expand Up @@ -452,6 +453,7 @@ struct TKikimrTableMetadata : public TThrRefBase {
, Kind(static_cast<EKikimrTableKind>(message->GetKind()))
, RecordsCount(message->GetRecordsCount())
, DataSize(message->GetDataSize())
, StatsLoaded(message->GetStatsLoaded())
, KeyColumnNames(message->GetKeyColunmNames().begin(), message->GetKeyColunmNames().end())

{
Expand Down Expand Up @@ -519,6 +521,7 @@ struct TKikimrTableMetadata : public TThrRefBase {
message->SetKind(static_cast<ui32>(Kind));
message->SetRecordsCount(RecordsCount);
message->SetDataSize(DataSize);
message->SetStatsLoaded(StatsLoaded);
for(auto& [key, value] : Attributes) {
message->AddAttributes()->SetKey(key);
message->AddAttributes()->SetValue(value);
Expand Down
1 change: 1 addition & 0 deletions ydb/core/protos/kqp.proto
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,7 @@ message TKqpTableMetadataProto {
repeated TKqpTableMetadataProto SecondaryGlobalIndexMetadata = 12;
optional uint64 RecordsCount = 13;
optional uint64 DataSize = 14;
optional bool StatsLoaded = 15;
}

message TRlPath {
Expand Down

0 comments on commit c1bd94c

Please sign in to comment.