You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When calculating the size of a partitioned table, only the size of one of the partitions will be counted.
Environment
OceanBase Diagnostic Tool: 2.5.0
Fast reproduce steps
create a partition table
CREATE TABLE sbtest3 ( id int(11) NOT NULL AUTO_INCREMENT, k int(11) NOT NULL DEFAULT '0', c char(120) NOT NULL DEFAULT '', pad char(60) NOT NULL DEFAULT '',
PRIMARY KEY (id),
KEY k_3 (k) BLOCK_SIZE 16384 LOCAL,
KEY idx_c (c) BLOCK_SIZE 16384 LOCAL
) partition by hash(id) partitions 9;
use the obdiag
obdiag gather tabledump --user=root@my#hucq_421 --password='aaBB11@@' --database=test --table=sbtest3
check the result
obclient > select /*+read_consistency(weak) QUERY_TIMEOUT(60000000) */ t1.SVR_IP,t1.role,ifnull(t2.data_size,0) as total_data_size from (select SVR_IP,tenant_id, database_name, role, table_id, tablet_id from oceanbase.cdb_ob_table_locations) t1 left join (select tenant_id, tablet_id,data_size from oceanbase.cdb_ob_tablet_replicas) t2 on t1.tenant_id = t2.tenant_id and t1.tablet_id = t2.tablet_id where t1.tenant_id = '1004' and t1.table_id = '500133' order by total_data_size desc limit 1
+--------------+----------+-------------------+
| SVR_IP | role | total_data_size |
+==============+==========+===================+
| 10.186.57.73 | FOLLOWER | 8497805 |
+--------------+----------+-------------------+
Expected behavior
In oceanbase.cdb_ob_tablet_replicas, each partition will have a row of records. Different partitions of the same table have the same table_id. If you want to count the size of the partitioned table, should be select sum(data_size) from oceanbase.cdb_ob_tablet_replicas group by table_id;
Actual behavior
No response
Additional context
No response
The text was updated successfully, but these errors were encountered:
Describe the bug
When calculating the size of a partitioned table, only the size of one of the partitions will be counted.
Environment
OceanBase Diagnostic Tool: 2.5.0
Fast reproduce steps
create a partition table
CREATE TABLE
sbtest3
(id
int(11) NOT NULL AUTO_INCREMENT,k
int(11) NOT NULL DEFAULT '0',c
char(120) NOT NULL DEFAULT '',pad
char(60) NOT NULL DEFAULT '',PRIMARY KEY (
id
),KEY
k_3
(k
) BLOCK_SIZE 16384 LOCAL,KEY
idx_c
(c
) BLOCK_SIZE 16384 LOCAL) partition by hash(id) partitions 9;
use the obdiag
obdiag gather tabledump --user=root@my#hucq_421 --password='aaBB11@@' --database=test --table=sbtest3
check the result
obclient > select /*+read_consistency(weak) QUERY_TIMEOUT(60000000) */ t1.SVR_IP,t1.role,ifnull(t2.data_size,0) as total_data_size from (select SVR_IP,tenant_id, database_name, role, table_id, tablet_id from oceanbase.cdb_ob_table_locations) t1 left join (select tenant_id, tablet_id,data_size from oceanbase.cdb_ob_tablet_replicas) t2 on t1.tenant_id = t2.tenant_id and t1.tablet_id = t2.tablet_id where t1.tenant_id = '1004' and t1.table_id = '500133' order by total_data_size desc limit 1
+--------------+----------+-------------------+
| SVR_IP | role | total_data_size |
+==============+==========+===================+
| 10.186.57.73 | FOLLOWER | 8497805 |
+--------------+----------+-------------------+
Expected behavior
In oceanbase.cdb_ob_tablet_replicas, each partition will have a row of records. Different partitions of the same table have the same table_id. If you want to count the size of the partitioned table, should be select sum(data_size) from oceanbase.cdb_ob_tablet_replicas group by table_id;
Actual behavior
No response
Additional context
No response
The text was updated successfully, but these errors were encountered: