Indexes for JSON Data

Learn how JSON indexes improve query performance, when each index type fits, and how to verify optimizer use.

Indexing JSON Data

This chapter explains how to index JSON data in Oracle Database to improve query performance. It focuses on the concepts behind JSON indexing, when to use each index type, and how to verify that the optimizer uses your indexes.

Indexing is essential because, without a suitable index, Oracle must scan every JSON document to evaluate filter or search criteria. Full table scans can be acceptable for analytical queries that read most documents, but they do not scale for frequent, targeted queries from one or more client applications.

Index Selectivity: Indexes accelerate access for common query patterns and help meet performance requirements, but they add storage cost and DML overhead. Create indexes for queries you expect to run often and for fields with sufficiently selective values. Avoid indexing fields that are rarely filtered or have few distinct values, such as Boolean or other low-cardinality fields, because the index might not significantly reduce the rows examined.

Use a JSON search index for ad hoc structural queries and full-text search. For more information, see JSON Search Index for Ad Hoc Queries and Full-Text Search.