B-Tree Based JSON Indexes

Single-value JSON indexes and multivalue JSON indexes are value indexes implemented with B-tree structures. The terms single-value and multivalue describe how many indexed scalar values a document can contribute; B-tree describes the index implementation. These are not competing index families.

Use a single-value JSON index when a path returns at most one scalar value per document. Use a multivalue JSON index when a path can return multiple values per document, typically from arrays or repeated fields. Both are intended for known, stable SQL/JSON path expressions, and the query path and data type must match the index definition.

In all cases, the optimizer can use the index only when the query uses a matching path expression and a matching SQL data type.

The main B-tree-based value index types are:

Note: Bitmap indexes are a separate index type. You can create them for json_value, but they are not B-tree indexes and are discussed separately.

Database Operations Accelerated by B-Tree Indexes

B-tree value indexes on JSON data, including single-value and multivalue JSON indexes, can improve performance for a broad range of database operations. Understanding which operations benefit from these indexes enables more effective query design and indexing strategies.

JSON B-tree indexes enhance performance for these categories of database operations: