Skip to content

Added metadata flag to track if stats for optimizer were loaded #7190

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -961,6 +961,7 @@ NThreading::TFuture<TTableMetadataResult> TKqpTableMetadataLoader::LoadTableMeta
auto s = resp.Simple;
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 @@ -424,6 +424,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 @@ -460,6 +461,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 @@ -527,6 +529,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 @@ -184,6 +184,7 @@ message TKqpTableMetadataProto {
repeated TKqpTableMetadataProto SecondaryGlobalIndexMetadata = 12;
optional uint64 RecordsCount = 13;
optional uint64 DataSize = 14;
optional bool StatsLoaded = 15;
}

message TRlPath {
Expand Down
Loading