Skip to main content
Get the disk space used by an index on a , including the disk space needed to provide the index on all s. The size is reported in bytes. For more information about using s, including size partitioning, see the hypertable section.

Samples

Get size of a specific index on a .
\d conditions_table
                     Table "public.conditions_table"
 Column |           Type           | Collation | Nullable | Default
--------+--------------------------+-----------+----------+---------
 time   | timestamp with time zone |           | not null |
 device | integer                  |           |          |
 volume | integer                  |           |          |
Indexes:
    "second_index" btree ("time")
    "test_table_time_idx" btree ("time" DESC)
    "third_index" btree ("time")

SELECT hypertable_index_size('second_index');

 hypertable_index_size
-----------------------
                163840

SELECT pg_size_pretty(hypertable_index_size('second_index'));

 pg_size_pretty
----------------
 160 kB

Arguments

NameTypeDefaultRequiredDescription
index_nameREGCLASS-Name of the index on a hypertable

Returns

ColumnTypeDescription
hypertable_index_sizeBIGINTReturns the disk space used by the index
If the function is executed on a non- relation, NULL is returned.