> ## Documentation Index
> Fetch the complete documentation index at: https://docs.paradedb.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Inspect an Index

<Danger>
  **Legacy Docs:** This page describes our legacy API. It will be deprecated in
  a future version. Please use the [v2 API](/) where possible.
</Danger>

## Version Info

`paradedb.version_info` returns the current ParadeDB extension version, the full
Git commit hash, and the build mode (`release` or `debug`).

```sql theme={null}
SELECT * FROM paradedb.version_info();
```

## Index Schema

`paradedb.schema` returns information about the index schema. This is useful for inspecting how an index was configured.

The following code block inspects an index called `search_idx`. The argument should be the index name quoted in a string.

```sql theme={null}
SELECT name, field_type FROM paradedb.schema('search_idx');
```

<ParamField body="index" required>
  The index to inspect.
</ParamField>

## Index Size

`pg_relation_size` can be used to inspect the index size. `pg_size_pretty` turns the size from bytes
into a human-readable format.

```sql theme={null}
SELECT pg_size_pretty(pg_relation_size('search_idx'));
```

## Index Segments

`paradedb.index_info` returns information about the index's underlying segments.

```sql theme={null}
SELECT * FROM paradedb.index_info('search_idx');
```

Generally speaking, the segment count should match the server's CPU count. In practice, it may be lower if the table is very small, or higher if there are so many rows
that a single segment is split into multiple segments.

In order for the index to maintain an optimal segment count, the index must have enough memory and threads for [creating](/documentation/performance-tuning/overview) and [writing](/documentation/performance-tuning/writes) to the index.

## Index Debugging

These functions are typically used by ParadeDB developers to debug the index.

### Merge Info

`paradedb.merge_info` returns a table containing information about any ongoing segment merge operations.
If writes to the index seem to be hanging, this function can be used to determine if a merge is occurring.

```sql theme={null}
SELECT paradedb.merge_info('search_idx');
```

### Vacuum Info

`paradedb.vacuum_info` returns a list of segment IDs that are currently being vacuumed.

```sql theme={null}
SELECT paradedb.vacuum_info('search_idx');
```
