Skip to main content
Get information about the disk space used by the s belonging to a , returning size information for each table, any indexes on the , any toast tables, and the total size associated with the . All sizes are reported in bytes. If the function is executed on a distributed , it returns disk space usage information as a separate row per node. The access node is not included since it doesn’t have any local data. Additional metadata associated with a can be accessed via the timescaledb_information.chunks view.

Samples

SELECT * FROM chunks_detailed_size('dist_table')
  ORDER BY chunk_name, node_name;

     chunk_schema      |      chunk_name       | table_bytes | index_bytes | toast_bytes | total_bytes |       node_name
-----------------------+-----------------------+-------------+-------------+-------------+-------------+-----------------------
 _timescaledb_internal | _dist_hyper_1_1_chunk |        8192 |       32768 |           0 |       40960 | data_node_1
 _timescaledb_internal | _dist_hyper_1_2_chunk |        8192 |       32768 |           0 |       40960 | data_node_2
 _timescaledb_internal | _dist_hyper_1_3_chunk |        8192 |       32768 |           0 |       40960 | data_node_3

Arguments

NameTypeDefaultRequiredDescription
hypertableREGCLASS-Name of the hypertable

Returns

ColumnTypeDescription
chunk_schemaTEXTSchema name of the chunk
chunk_nameTEXTName of the chunk
table_bytesBIGINTDisk space used by the chunk table
index_bytesBIGINTDisk space used by indexes
toast_bytesBIGINTDisk space of toast tables
total_bytesBIGINTTotal disk space used by the chunk, including all indexes and TOAST data
node_nameTEXTNode for which size is reported, applicable only to distributed s
If executed on a relation that is not a , the function returns NULL.