# Indexes and constraints

[Wiki](../README.md)

**On this page**

- [Which index for which job?](#which-index-for-which-job)
- [Persistence of indexes](#persistence-of-indexes)
- [Articles](#articles)

## Which index for which job?

| You want to… | Use |
|---|---|
| Fast exact lookup `… {prop: v}` / `WHERE n.prop = v` | **Property index** ([Property, range and composite indexes](property.md#property-indexes)) |
| Ordered range or prefix predicates | [Range/composite indexes](property.md#range-ordered-indexes) |
| Membership or position inside list properties | [Element indexes](element.md) |
| Require a value, tuple, shared or per-element identity | [Constraint families](constraints.md) |
| Look up relationships by a property value or range | **Relationship index** ([Relationship property indexes](relationship.md)) |
| Require a property to hold one type of value | **Property type constraint** ([Constraints](constraints.md#property-type-constraints)) |
| Guarantee a property is unique per label | **Uniqueness constraint** ([Constraints and shared uniqueness](constraints.md#uniqueness-constraints)) |
| Relevance-ranked text search over a string property | **Full-text index** + `SEARCH` ([Full-text search](fulltext.md#full-text-search-bm25)) |
| Nearest-neighbour over embedding vectors | **Vector index** ([Vector search](vector.md#vector-ann-index)) |
| Distance / radius queries over points | **Point index** ([Spatial indexes](spatial.md#point-spatial-index)) |
| Find shapes intersecting a query geometry | **Spatial shape index** and explicit `db.index.spatial.intersects` ([Spatial indexes](spatial.md#shape-index)) |

## Persistence of indexes

For a complete inventory, `SHOW INDEXES` lists every index of every kind and
`SHOW CONSTRAINTS` every constraint, each with its name. Every index and
constraint has a name, and `DROP INDEX name` / `DROP CONSTRAINT name` drop
any kind by name ([Index and constraint names](names.md)).

All indexes are **declaration-only** on disk: the declaration is persisted (in the
WAL/snapshot), and the index contents are rebuilt by re-reading the stored values
on replay/restore. This keeps the on-disk format small and means an index can
never hold stale entries after a restart. See
[Operations](../operations/README.md).

## Articles

- [Constraints and shared uniqueness](constraints.md)
- [Element indexes and staged values](element.md)
- [Full-text search](fulltext.md)
- [Index and constraint names](names.md)
- [Property, range and composite indexes](property.md)
- [Relationship property indexes](relationship.md)
- [Spatial indexes](spatial.md)
- [Vector search](vector.md)

## Related articles

[EXPLAIN and PROFILE](../cypher/planning.md) · [Resident and hybrid storage](../operations/storage.md) · [Schema and maintenance procedures](../cypher/procedures.md)
