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:
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: Since the Query Service accesses GSIs, rather than data maintained in documents, it is not obliged to track how original and replica vBuckets are dispersed across nodes running the Data Service. Moreover, since the GSIs reside on specific cluster-nodes running the Index Service, the Query Service can access the GSIs directly, without needing to use hashing routines.
Advanced Scaling: GSIs can be assigned independently to selected nodes, without existing workloads being affected.
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.