Get the total disk space used by a or ,
that is, the sum of the size for the table itself including s,
any indexes on the table, and any toast tables. The size is reported
in bytes. This is equivalent to computing the sum of total_bytes
column from the output of hypertable_detailed_size function.
When a name is provided, the function
transparently looks up the backing and returns its statistics
instead.
For more information about using s, including size partitioning,
see the hypertable section.
Samples
Get the size information for a .
SELECT hypertable_size('devices');
hypertable_size
-----------------
73728
Get the size information for all s.
SELECT hypertable_name, hypertable_size(format('%I.%I', hypertable_schema, hypertable_name)::regclass)
FROM timescaledb_information.hypertables;
Get the size information for a .
SELECT hypertable_size('device_stats_15m');
hypertable_size
-----------------
73728
Arguments
| Name | Type | Default | Required | Description |
hypertable | REGCLASS | - | ✔ | or to show size of. |
Returns
| Name | Type | Description |
| hypertable_size | BIGINT | Total disk space used by the specified , including all indexes and TOAST data |
NULL is returned if the function is executed on a non- relation.