Select a documentation version: <button class="button button-with-icon cloud-select-dropdown__button button-primary" aria-haspopup="true">15.7.0</button>

- [Current (18.4.0)](https://docs.cloud.google.com/alloydb/omni/kubernetes/current/docs/ai/maintain-vector-indexes.md.txt)
- [18.4.0](https://docs.cloud.google.com/alloydb/omni/kubernetes/18.4.0/docs/ai/maintain-vector-indexes.md.txt)
- [18.3.0](https://docs.cloud.google.com/alloydb/omni/kubernetes/18.3.0/docs/ai/maintain-vector-indexes.md.txt)
- [18.1.0](https://docs.cloud.google.com/alloydb/omni/kubernetes/18.1.0/docs/ai/maintain-vector-indexes.md.txt)
- [17.10.0](https://docs.cloud.google.com/alloydb/omni/kubernetes/17.10.0/docs/ai/maintain-vector-indexes.md.txt)
- [17.9.0](https://docs.cloud.google.com/alloydb/omni/kubernetes/17.9.0/docs/ai/maintain-vector-indexes.md.txt)
- [17.7.0](https://docs.cloud.google.com/alloydb/omni/kubernetes/17.7.0/docs/ai/maintain-vector-indexes.md.txt)
- [17.5.0](https://docs.cloud.google.com/alloydb/omni/kubernetes/17.5.0/docs/ai/maintain-vector-indexes.md.txt)
- [16.14.0](https://docs.cloud.google.com/alloydb/omni/kubernetes/16.14.0/docs/ai/maintain-vector-indexes.md.txt)
- [16.13.0](https://docs.cloud.google.com/alloydb/omni/kubernetes/16.13.0/docs/ai/maintain-vector-indexes.md.txt)
- [16.11.0](https://docs.cloud.google.com/alloydb/omni/kubernetes/16.11.0/docs/ai/maintain-vector-indexes.md.txt)
- [16.9.0](https://docs.cloud.google.com/alloydb/omni/kubernetes/16.9.0/docs/ai/maintain-vector-indexes.md.txt)
- [16.8.0](https://docs.cloud.google.com/alloydb/omni/kubernetes/16.8.0/docs/ai/maintain-vector-indexes.md.txt)
- [16.3.0](https://docs.cloud.google.com/alloydb/omni/kubernetes/16.3.0/docs/ai/maintain-vector-indexes.md.txt)
- [15.18.0](https://docs.cloud.google.com/alloydb/omni/kubernetes/15.18.0/docs/ai/maintain-vector-indexes.md.txt)
- [15.17.0](https://docs.cloud.google.com/alloydb/omni/kubernetes/15.17.0/docs/ai/maintain-vector-indexes.md.txt)
- [15.15.0](https://docs.cloud.google.com/alloydb/omni/kubernetes/15.15.0/docs/ai/maintain-vector-indexes.md.txt)
- [15.13.0](https://docs.cloud.google.com/alloydb/omni/kubernetes/15.13.0/docs/ai/maintain-vector-indexes.md.txt)
- [15.12.0](https://docs.cloud.google.com/alloydb/omni/kubernetes/15.12.0/docs/ai/maintain-vector-indexes.md.txt)
- [15.7.1](https://docs.cloud.google.com/alloydb/omni/kubernetes/15.7.1/docs/ai/maintain-vector-indexes.md.txt)
- [15.7.0](https://docs.cloud.google.com/alloydb/omni/kubernetes/15.7.0/docs/ai/maintain-vector-indexes.md.txt)

<br />

This document explains different options that you can use to maintain vector indexes. You might want to maintain indexes to ensure that your indexes adapt to the changes in data that might impact accuracy of your search results. As your dataset grows, use the strategies in the following sections to avoid degradation in query performance.

<br />

## View vector index metrics

If your table is prone to frequent updates or insertions, then we recommend
periodically [reindexing the existing ScaNN index](https://docs.cloud.google.com/alloydb/omni/kubernetes/15.7.0/docs/ai/maintain-vector-indexes.md.txt#manually-rebuild-index)
in order to improve the recall accuracy for your index. You can monitor
index metrics to view changes in vector distributions or vector mutations since
the index was built, and then reindex accordingly.

For more information about metrics, see [View Vector index metrics](https://docs.cloud.google.com/alloydb/omni/kubernetes/15.7.0/docs/reference/vector-index-metrics.md.txt).

## Manually rebuild your index

You can manually rebuild your index if you want to
rebuild it with the configurations you specified when it was created.

To manually rebuild your index, run the following command:

```sql
REINDEX INDEX CONCURRENTLY INDEX_NAME;
```

Replace `INDEX_NAME` with the name of the index you want to
rebuild---for example, `my-scann-index`. The index names are shared
across your database. Ensure that each index name is unique to each
table in your database.

For more information about reindexing in PostgreSQL, see
[REINDEX](https://www.postgresql.org/docs/15/sql-reindex.html).

## What's next

- [Vector index metrics](https://docs.cloud.google.com/alloydb/omni/kubernetes/15.7.0/docs/reference/vector-index-metrics.md.txt)
- [Optimize vector query performance for ScaNN](https://docs.cloud.google.com/alloydb/omni/kubernetes/15.7.0/docs/ai/scann-vector-query-perf-overview.md.txt)