Skip to content

Commit d96c0fd

Browse files
Added metadata flag to track if stats for optimizer were loaded (#7190)
1 parent 3c55a62 commit d96c0fd

File tree

3 files changed

+5
-0
lines changed

3 files changed

+5
-0
lines changed

ydb/core/kqp/gateway/kqp_metadata_loader.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -961,6 +961,7 @@ NThreading::TFuture<TTableMetadataResult> TKqpTableMetadataLoader::LoadTableMeta
961961
auto s = resp.Simple;
962962
result.Metadata->RecordsCount = s.RowCount;
963963
result.Metadata->DataSize = s.BytesSize;
964+
result.Metadata->StatsLoaded = true;
964965
promise.SetValue(result);
965966
});
966967

ydb/core/kqp/provider/yql_kikimr_gateway.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -424,6 +424,7 @@ struct TKikimrTableMetadata : public TThrRefBase {
424424
ui64 DataSize = 0;
425425
ui64 MemorySize = 0;
426426
ui32 ShardsCount = 0;
427+
bool StatsLoaded = false;
427428

428429
TInstant LastAccessTime;
429430
TInstant LastUpdateTime;
@@ -460,6 +461,7 @@ struct TKikimrTableMetadata : public TThrRefBase {
460461
, Kind(static_cast<EKikimrTableKind>(message->GetKind()))
461462
, RecordsCount(message->GetRecordsCount())
462463
, DataSize(message->GetDataSize())
464+
, StatsLoaded(message->GetStatsLoaded())
463465
, KeyColumnNames(message->GetKeyColunmNames().begin(), message->GetKeyColunmNames().end())
464466

465467
{
@@ -527,6 +529,7 @@ struct TKikimrTableMetadata : public TThrRefBase {
527529
message->SetKind(static_cast<ui32>(Kind));
528530
message->SetRecordsCount(RecordsCount);
529531
message->SetDataSize(DataSize);
532+
message->SetStatsLoaded(StatsLoaded);
530533
for(auto& [key, value] : Attributes) {
531534
message->AddAttributes()->SetKey(key);
532535
message->AddAttributes()->SetValue(value);

ydb/core/protos/kqp.proto

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,7 @@ message TKqpTableMetadataProto {
184184
repeated TKqpTableMetadataProto SecondaryGlobalIndexMetadata = 12;
185185
optional uint64 RecordsCount = 13;
186186
optional uint64 DataSize = 14;
187+
optional bool StatsLoaded = 15;
187188
}
188189

189190
message TRlPath {

0 commit comments

Comments
 (0)