Download PDFSubmit Feedback

  • Viewing Storage and Compression Information

Storage and Compression

Viewing Storage and Compression Information

The SHOW DISTRIBUTION statement displays the storage space and compression ratio of a specified time-series database or time-series table.

Note

The compression ratio is a rough calculation and may differ from the actual compression performance. When calculating the compression ratio, the uncompressed data length is calculated based on the column width specified when creating the table. Therefore, for variable-length columns (such as VARCHAR type), if the defined column width is much larger than the actual written data length (for example, defining VARCHAR(1000) but only writing a few characters), the compression ratio will be overestimated.

Privileges

None

Syntax

Parameters

ParameterDescription
db_nameThe name of the time-series database to view.
table_nameThe name of the time-series table to view. Supports specifying tables in other time-series databases using the db_name.table_name format. When no database is specified, it refers to tables in the current database.

Return Fields

Return fields when viewing a database:

FieldDescription
nodeNode identifier.
blocks_numNumber of data blocks.
blocks_sizeDisk space used.
avg_sizeAverage data block size.
compression_ratioRoughly calculated compression ratio.

Return fields when viewing a table:

FieldDescription
node_idNode identifier.
levelCompression level, including last segment (latest segment), entity segment (entity segment), and total (total).
blocks_numNumber of data blocks.
blocks_sizeDisk space used.
avg_sizeAverage data block size.
compression_ratioRoughly calculated compression ratio.

Examples

  • View storage and compression information for a specified database.

    SHOW DISTRIBUTION FROM DATABASE iot;
    
  • View storage and compression information for a specified table.

    SHOW DISTRIBUTION FROM TABLE sensors;