> ## Documentation Index
> Fetch the complete documentation index at: https://mintlify-poc.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# hypertable_index_size()

> Get the disk space used by a hypertable index

export const CHUNK_CAP = 'Chunk';

export const CHUNK = 'chunk';

export const HYPERTABLE_CAP = 'Hypertable';

export const HYPERTABLE = 'hypertable';

<Icon icon="tag" iconType="duotone" /> Since [0.2.0][tsdb-0.2.0]

Get the disk space used by an index on a {HYPERTABLE}, including the
disk space needed to provide the index on all {CHUNK}s. The size is
reported in bytes.

For more information about using {HYPERTABLE}s, including {CHUNK} size partitioning,
see the [hypertable section][hypertable-docs].

## Samples

Get size of a specific index on a {HYPERTABLE}.

```sql theme={"dark"}
\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

The syntax is:

```sql theme={"dark"}
SELECT hypertable_index_size('<index_name>');
```

| Name         | Type     | Default | Required | Description                       |
| ------------ | -------- | ------- | -------- | --------------------------------- |
| `index_name` | REGCLASS | -       | ✔        | Name of the index on a hypertable |

## Returns

| Column                  | Type   | Description                              |
| ----------------------- | ------ | ---------------------------------------- |
| hypertable\_index\_size | BIGINT | Returns the disk space used by the index |

If the function is executed on a non-{HYPERTABLE} relation, `NULL` is returned.

[hypertable-docs]: /use-timescale/hypertables/

[tsdb-0.2.0]: https://github.com/timescale/timescaledb/releases/tag/0.2.0
