A newer version of this documentation is available.

View Latest

Global Secondary Indexes

A Global Secondary Index (GSI) supports queries made by the Query Service on attributes within documents. Extensive filtering is supported.

Global Secondary Indexes provide the following:

  • Advanced Scaling: GSIs can be assigned independently to selected nodes, without existing workloads being affected.

  • Predictable Performance: Key-based operations maintain predictable low-latency, even in the presence of a large number of indexes. Index-maintenance is non-competitive with key-based operations, even when data-mutation workloads are heavy.

  • Low Latency Querying: GSIs independently partition into the Index Service nodes: they do not have to follow hash partitioning of data into vBuckets. Queries using GSIs can achieve low latency response times even when the cluster scales out; since GSIs do not require a wide fan-out to all Data Service nodes.

  • Independent Partitioning: The Index Service provides partition independence: data and its indexes can have different partition keys. Each index can have its own partition key, so each can be partitioned independently to match the specific query. As new requirements arise, the application will also be able to create a new index with a new partition key, without affecting performance of existing queries.

Creating Global Secondary Indexes

Both Primary and Secondary indexes can be created by means of the N1QL query-language; using the CREATE INDEX statement and the USING GSI clause. For more information, see CREATE INDEX.