obdiag analyze index_space

2024-11-19 02:07:31  Updated

You can run this command to analyze the space size of an existing index or an index to be created. Before you create an index, you can analyze its required space size based on the indexed column to avoid insufficient disk space.

Syntax

obdiag analyze index_space [option]

The following table describes the options.

Option Required? Data type Default value Description
--tenant_name Yes string Empty The name of the tenant.
--table_name Yes string Empty The name of the table.
--index_name No string Empty The name of the index.
--column_names No string Empty The name of the column. You can specify multiple column names separated with commas (,), for example, col1,col2,col3.

Examples

  • Analyze the space size of an existing index

    $ obdiag analyze index_space --tenant_name=test --table_name=student --index_name=name_index
    

    The output is as follows:

    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
    
  • Analyze the space size of an index to be created based on the specified indexed column

    $ obdiag analyze index_space --tenant_name=CHAT_BI --table_name=student --column_names=name
    

    The output is as follows:

    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
    

Contact Us