From 02a8b2f7d981f5519eab3ca65f30090bf787ddf3 Mon Sep 17 00:00:00 2001 From: Dennis Zhuang Date: Tue, 12 Nov 2024 16:47:00 +0800 Subject: [PATCH] fix: physical table statistics info --- .../src/system_schema/information_schema/tables.rs | 9 ++++++++- src/common/meta/src/datanode.rs | 2 +- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/catalog/src/system_schema/information_schema/tables.rs b/src/catalog/src/system_schema/information_schema/tables.rs index b258b857b2db..a786cbca2b69 100644 --- a/src/catalog/src/system_schema/information_schema/tables.rs +++ b/src/catalog/src/system_schema/information_schema/tables.rs @@ -34,6 +34,7 @@ use datatypes::vectors::{ }; use futures::TryStreamExt; use snafu::{OptionExt, ResultExt}; +use store_api::metric_engine_consts::PHYSICAL_TABLE_METADATA_KEY; use store_api::storage::{RegionId, ScanRequest, TableId}; use table::metadata::{TableInfo, TableType}; @@ -259,7 +260,13 @@ impl InformationSchemaTablesBuilder { let table_info = table.table_info(); // TODO(dennis): make it working for metric engine - let table_region_stats = if table_info.meta.engine == MITO_ENGINE { + let table_region_stats = if table_info.meta.engine == MITO_ENGINE + || table_info + .meta + .options + .extra_options + .contains_key(PHYSICAL_TABLE_METADATA_KEY) + { let region_ids = table_info .meta .region_numbers diff --git a/src/common/meta/src/datanode.rs b/src/common/meta/src/datanode.rs index 869af96a2828..03226027ca30 100644 --- a/src/common/meta/src/datanode.rs +++ b/src/common/meta/src/datanode.rs @@ -77,7 +77,7 @@ pub struct RegionStat { pub rcus: i64, /// The write capacity units during this period pub wcus: i64, - /// Approximate bytes of this region + /// Approximate disk bytes of this region, including sst, index, manifest and wal pub approximate_bytes: u64, /// The engine name. pub engine: String,