首批通过分布式安全可靠测评,为关键业务系统打造
索引空间分析使用说明
更新时间:2026-04-13 17:11:17
obdiag analyze index_space 可以一键分析已创建索引和未创建索引(指定索引列)的空间大小,在创建索引前分析即将创建索引的空间大小对于预防磁盘空间报警非常有帮助。
使用说明
obdiag analyze index_space [option]
选项说明如下:
| 选项名 | 是否必选 | 数据类型 | 默认值 | 说明 |
|---|---|---|---|---|
| --tenant_name | 是 | string | 默认为空 | 租户名称 |
| --table_name | 是 | string | 默认为空 | 表名称 |
| --index_name | 否 | string | 默认为空 | 索引名称 |
| --column_names | 否 | string | 默认为空 | 列名称,指定多列用逗号分隔,例如:col1,col2,col3 |
使用示例
分析已存在索引空间大小
$ obdiag analyze index_space --tenant_name=test --table_name=student --index_name=name_index输出如下:
analyze_index_space start ... start query estimated_table_data_size, please wait some minutes... ok +--------------------------------------------------------------------+ | estimated-index-space-report | +--------------+------+-----------------------+----------------------+ | ip | port | estimated_index_space | available_disk_space | +--------------+------+-----------------------+----------------------+ | 10.10.10.1 | 2882 | 2.57 KB | 55.07 GB | | 10.10.10.3 | 2882 | 2.57 KB | 55.07 GB | | 10.10.10.2 | 2882 | 3.50 KB | 54.98 GB | +--------------+------+-----------------------+----------------------+ Trace ID: 9cbf48b0-6a9f-11ef-82ec-000c2934fb31 If you want to view detailed obdiag logs, please run: main.py display-trace 9cbf48b0-6a9f-11ef-82ec-000c2934fb31分析未创建索引空间,通过索引列分析
$ obdiag analyze index_space --tenant_name=CHAT_BI --table_name=student --column_names=name输出如下:
analyze_index_space start ... start query estimated_table_data_size, please wait some minutes... ok +--------------------------------------------------------------------+ | estimated-index-space-report | +--------------+------+-----------------------+----------------------+ | ip | port | estimated_index_space | available_disk_space | +--------------+------+-----------------------+----------------------+ | 10.10.10.1 | 2882 | 2.57 KB | 55.07 GB | | 10.10.10.2 | 2882 | 3.50 KB | 54.98 GB | | 10.10.10.3 | 2882 | 2.57 KB | 55.07 GB | +--------------+------+-----------------------+----------------------+ Trace ID: e71c5cc2-6a9f-11ef-9373-000c2934fb31 If you want to view detailed obdiag logs, please run: main.py display-trace e71c5cc2-6a9f-11ef-9373-000c2934fb31