Skip to main content
Since 2.18.0 Retrieve statistics about the s in the chunk_columnstore_stats returns the size of s in the , these values are computed when you call either: Inserting into a in the does not change the size. For more information about how to compute sizes, see chunks_detailed_size.

Samples

To retrieve statistics about s:
  • Show the status of the first two s in the conditions :
    SELECT * FROM chunk_columnstore_stats('conditions')
      ORDER BY chunk_name LIMIT 2;
    
    Returns:
    -[ RECORD 1 ]------------------+----------------------
    chunk_schema                   | _timescaledb_internal
    chunk_name                     | _hyper_1_1_chunk
    compression_status             | Uncompressed
    before_compression_table_bytes |
    before_compression_index_bytes |
    before_compression_toast_bytes |
    before_compression_total_bytes |
    after_compression_table_bytes  |
    after_compression_index_bytes  |
    after_compression_toast_bytes  |
    after_compression_total_bytes  |
    node_name                      |
    -[ RECORD 2 ]------------------+----------------------
    chunk_schema                   | _timescaledb_internal
    chunk_name                     | _hyper_1_2_chunk
    compression_status             | Compressed
    before_compression_table_bytes | 8192
    before_compression_index_bytes | 32768
    before_compression_toast_bytes | 0
    before_compression_total_bytes | 40960
    after_compression_table_bytes  | 8192
    after_compression_index_bytes  | 32768
    after_compression_toast_bytes  | 8192
    after_compression_total_bytes  | 49152
    node_name                      |
    
  • Use pg_size_pretty to return a more human friendly format:
    SELECT pg_size_pretty(after_compression_total_bytes) AS total
      FROM chunk_columnstore_stats('conditions')
      WHERE compression_status = 'Compressed';
    
    Returns:
    -[ RECORD 1 ]--+------
    total | 48 kB
    

Arguments

NameTypeDefaultRequiredDescription
hypertableREGCLASS-The name of a

Returns

ColumnTypeDescription
chunk_schemaTEXTSchema name of the .
chunk_nameTEXTName of the .
compression_statusTEXTCurrent compression status of the .
before_compression_table_bytesBIGINTSize of the heap before compression. Returns NULL if compression_status == Uncompressed.
before_compression_index_bytesBIGINTSize of all the indexes before compression. Returns NULL if compression_status == Uncompressed.
before_compression_toast_bytesBIGINTSize the TOAST table before compression. Returns NULL if compression_status == Uncompressed.
before_compression_total_bytesBIGINTSize of the entire chunk table (before_compression_table_bytes + before_compression_index_bytes + before_compression_toast_bytes) before compression. Returns NULL if compression_status == Uncompressed.
after_compression_table_bytesBIGINTSize of the heap after compression. Returns NULL if compression_status == Uncompressed.
after_compression_index_bytesBIGINTSize of all the indexes after compression. Returns NULL if compression_status == Uncompressed.
after_compression_toast_bytesBIGINTSize the TOAST table after compression. Returns NULL if compression_status == Uncompressed.
after_compression_total_bytesBIGINTSize of the entire table (after_compression_table_bytes + after_compression_index_bytes + after_compression_toast_bytes) after compression. Returns NULL if compression_status == Uncompressed.
node_nameTEXTDEPRECATED: nodes the is located on, applicable only to distributed s.