我现在想统计一下OB每张表的大小及其索引大小,目前统计索引大小使用的SQL如下(3节点):
select round(sum(h.required_size/3)/1024/1024,2) as index_size
from oceanbase.dba_ob_tablet_replicas h where h.tablet_id in(select DISTINCT(tablet_id)
from oceanbase.dba_ob_table_locations where data_table_id in (select DISTINCT(table_id)
from oceanbase.dba_ob_table_locations where table_name =’%s’ and role=‘LEADER’)
请问,这样统计是否有问题,或者是否还有更好的统计方法,求大佬们指导