Choosing the Right JSON Index
Choose a JSON index that matches the query pattern and the behavior of the indexed field.
Oracle provides several JSON index types. Start by identifying the query pattern—targeted lookup or ad hoc search—and the field’s cardinality—single value or multiple values per document. That combination determines the best index.
Index Selection Guidelines
Use these guidelines:
- Use a JSON search index when you need ad hoc queries across many fields or full-text search. It is designed for flexible search patterns rather than a single, fixed path.
- Use a single-value JSON index when the path returns at most one scalar value per document, such as a single email or status. It is optimized for exact lookups and comparisons on one value.
- Use a multivalue JSON index when a path can return multiple values per document, such as values inside arrays. A multivalue JSON index is safer when schema evolution might later allow a field to repeat, even if it currently contains one value. It indexes all matching values so array searches stay efficient.
- Use a function-based HNSW vector index when JSON documents contain vector embeddings and you need similarity search. The index uses an expression, such as
JSON_VALUE, to extract a vector from a JSON field.
Performance Comparison
JSON value indexes, JSON search indexes, and vector indexes use different index structures and are suited to different query patterns.
| Index type | Index structure | Best suited for | DML cost |
|---|---|---|---|
| Value indexes (single-value and multivalue JSON indexes) | B-tree | Targeted retrieval using known JSON paths | Typically lower |
| JSON search indexes | Posting lists | Broader structural queries, ad hoc search, and full-text search | Typically higher |
| Function-based vector indexes | HNSW vector index | Vector similarity search over embeddings stored in JSON | Additional index-maintenance cost; online index creation required |
JSON Index Selection Decision Tree

The image is a decision-tree diagram for choosing a JSON index type.
The decision tree covers JSON value indexes and JSON search indexes. For similarity search over vector embeddings stored in JSON, use a function-based HNSW vector index.
Given the sample data:
$.notescontains free text and is a good candidate for full-text search. Use a JSON search index on this field.$.traveler.emailoccurs at most once per document because it is nested in an object. Use a single-value JSON index.$.reservations[*].confirmationNumberis inside an array and can occur multiple times per document. Use a multivalue JSON index.
If the data is stored in a JSON collection table, the _id field ($._id) is indexed by default with a unique index. No additional index is required for lookups by document ID.