Get the approximate total disk space used by a hypertable
Since 2.13.0Get the approximate 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_approximate_detailed_size function.When a name is provided, the function
transparently looks up the backing and returns its statistics
instead.
This function relies on the per backend caching using the in-built
storage manager layer to compute the approximate size
cheaply. The PG cache invalidation clears off the cached size for a
when DML happens into it. That size cache is thus able to get
the latest size in a matter of minutes. Also, due to the backend
caching, any long running session will only fetch latest data for new
or modified s and can use the cached data (which is calculated
afresh the first time around) effectively for older s. Thus it
is recommended to use a single connected backend session to
compute the approximate sizes of s to get faster results.
For more information about using s, including size partitioning,
see the hypertable section.