【 使用环境 】测试环境
【 OB or 其他组件 】Ob
【 使用版本 】4.2社区版
【问题描述】某个表在同样的建表语句、同样的数据的情况下,在ob3.2商业版中大小为10g,在4.2社区版中是100g,都是3节点的分布式部署,请问这可能是什么原因。此处的大小均是经过了晚间的自动合并后的结果。
另外,如何查询某个表的空间占用情况。
谢谢。
【复现路径】
【问题现象及影响】
【附件】
【 使用环境 】测试环境
【 OB or 其他组件 】Ob
【 使用版本 】4.2社区版
【问题描述】某个表在同样的建表语句、同样的数据的情况下,在ob3.2商业版中大小为10g,在4.2社区版中是100g,都是3节点的分布式部署,请问这可能是什么原因。此处的大小均是经过了晚间的自动合并后的结果。
另外,如何查询某个表的空间占用情况。
谢谢。
【复现路径】
【问题现象及影响】
【附件】
show create table 看看都是一样的吗?
一样的。
– hds.ashmx definition
CREATE TABLE ashmx
(
ZHANGH
char(20) NOT NULL,
JIOYRQ
char(8) NOT NULL,
ZHUJRQ
char(8) DEFAULT NULL,
JIOYSJ
int(11) DEFAULT NULL,
JIAOYM
char(4) DEFAULT NULL,
PNGZHH
char(13) DEFAULT NULL,
JIEDBZ
char(1) DEFAULT NULL,
JIO1JE
decimal(13,2) DEFAULT NULL,
ZHHUYE
decimal(15,2) DEFAULT NULL,
YUEEXZ
char(1) DEFAULT NULL,
YUEEFX
char(1) DEFAULT NULL,
KEHUZH
char(20) DEFAULT NULL,
KHZHLX
char(1) DEFAULT NULL,
SHUNXH
char(4) DEFAULT NULL,
YNGYJG
char(4) DEFAULT NULL,
ZHNGJG
char(4) DEFAULT NULL,
ZHYYJG
char(4) DEFAULT NULL,
ZHKJJG
char(4) DEFAULT NULL,
JIO1GY
char(8) DEFAULT NULL,
SHOQGY
char(8) DEFAULT NULL,
GUIYLS
char(12) NOT NULL,
YNGYLS
char(12) DEFAULT NULL,
XNZHBZ
char(1) DEFAULT NULL,
ZHYODM
char(22) DEFAULT NULL,
CPZNXH
int(11) NOT NULL,
CHBUBZ
char(1) DEFAULT NULL,
YNJYRQ
char(8) DEFAULT NULL,
SHJNCH
int(11) DEFAULT NULL,
JILUZT
char(1) DEFAULT NULL,
DUIFMC
char(62) DEFAULT NULL,
SBHHAO
char(12) DEFAULT NULL,
SHKHHM
char(62) DEFAULT NULL,
REMARK
char(60) DEFAULT NULL,
CPBH03
char(4) DEFAULT NULL,
DUIFZH
char(32) DEFAULT NULL,
TXN_SEQ
varchar(50) DEFAULT NULL,
TXN_TP
varchar(50) DEFAULT NULL,
RMRK
varchar(10) DEFAULT NULL,
PRIMARY KEY (JIOYRQ
, GUIYLS
, CPZNXH
, ZHANGH
),
KEY ashmx_IDX_1
(ZHANGH
, JIOYRQ
) BLOCK_SIZE 16384 LOCAL,
KEY ashmx_IDX_2
(KEHUZH
, JIOYRQ
) BLOCK_SIZE 16384 LOCAL
) DEFAULT CHARSET = utf8mb4 ROW_FORMAT = DYNAMIC COMPRESSION = ‘zstd_1.3.8’ REPLICA_NUM = 3 BLOCK_SIZE = 16384 USE_BLOOM_FILTER = FALSE TABLET_SIZE = 134217728 PCTFREE = 0
partition by key(zhangh
) subpartition by range columns(JIOYRQ
) subpartition template (
subpartition ashmx_2009
values less than (‘20100101’),
subpartition ashmx_2010
values less than (‘20110101’),
subpartition ashmx_2011
values less than (‘20120101’),
subpartition ashmx_2012
values less than (‘20130101’),
subpartition ashmx_2013
values less than (‘20140101’),
subpartition ashmx_2014
values less than (‘20150101’),
subpartition ashmx_2015
values less than (‘20160101’),
subpartition ashmx_2016
values less than (‘20170101’),
subpartition ashmx_2017
values less than (‘20180101’),
subpartition ashmx_2018
values less than (‘20190101’),
subpartition ashmx_2019
values less than (‘20200101’),
subpartition ashmx_2020
values less than (‘20210101’),
subpartition ashmx_2021
values less than (‘20220101’),
subpartition ashmx_2022
values less than (‘20230101’),
subpartition ashmx_2023
values less than (‘20240101’),
subpartition ashmx_2024
values less than (‘20250101’),
subpartition ashmx_2025
values less than (‘20260101’),
subpartition ashmx_2026
values less than (‘20270101’),
subpartition ashmx_2027
values less than (‘20280101’),
subpartition ashmx_2028
values less than (‘20290101’),
subpartition ashmx_2029
values less than (‘20300101’),
subpartition ashmx_2030
values less than (‘20310101’),
subpartition ashmx_2031
values less than (‘20320101’),
subpartition ashmx_2032
values less than (‘20330101’),
subpartition ashmx_2033
values less than (‘20340101’),
subpartition ashmx_2034
values less than (‘20350101’),
subpartition ashmx_2035
values less than (‘20360101’),
subpartition ashmx_2036
values less than (‘20370101’),
subpartition ashmx_2037
values less than (‘20380101’),
subpartition ashmx_2038
values less than (‘20390101’),
subpartition ashmx_2039
values less than (‘20400101’),
subpartition ashmx_2040
values less than (‘20410101’))
partitions 256;
用黑屏命令查查看呢?
4x
select /*+ query_timeout(30000000) */ a.TENANT_ID, a.DATABASE_NAME,
a.TABLE_NAME, a.TABLE_ID,
sum(
case
when
b.nested_offset = 0 then
IFNULL(b.data_block_count+b.index_block_count+b.linked_block_count, 0) * 2 *
1024 * 1024
else
IFNULL(b.size, 0)
end
) /1024.0/1024/1024 as data_size_in_GB
from CDB_OB_TABLE_LOCATIONS a inner join __all_virtual_table_mgr b
on a.svr_ip = b.svr_ip and a.svr_port=b.svr_port and a.tenant_id =
b.tenant_id and a.LS_ID = b.LS_ID and a.TABLET_ID = b.TABLET_ID
and a.role =
'LEADER' and a.tenant_id = xxx
and
b.table_type >= 10 and b.size > 0 group by a.TABLE_ID;
3x
select
b.tenant_id, b.table_id, count(distinct(c.macro_idx_in_data_file)) * 2 as
disk_size_in_MB
from
__all_virtual_table b
inner join
__all_virtual_partition_sstable_macro_info c on b.tenant_id = c.tenant_id and
b.table_id = c.table_id
where
b.tenant_id = xxx and b.table_id=yyy group by c.svr_ip, c.svr_port;