Details
-
Improvement
-
Resolution: Fixed
-
Major
-
Trinity
-
None
Description
We need to add a section to the documentation covering sequential scans. I propose such a section be added to https://docs.couchbase.com/server/current/n1ql/n1ql-intro/queriesandresults.html between "Query Optimization Using Prepared Statements" and "Indexes", but perhaps it warrants a dedicated section along-side "Using Indexes".
Sequential Scans
Note: Sequential scans are not available on ephemeral buckets.
When a keyspace has no suitable indexes defined to support a query, a sequential scan may be used to retrieve the document keys. Sequential scans are intended for simple, ready access to data and are not intended as a high performance solution. A user must be granted the "query_use_sequential_scans" role on the keyspace in order to execute a request with a sequential scan.
Sequential scans are best suited to small collections and where key order is unimportant or where the overhead of maintaining an index can't be justified. For larger collections and greater performance queries should still use the appropriate index(es). For ordered document key operations a primary index provides the same functionality and will outperform a sequential scan.
In most environments sequential scans that produce a large number of keys are an indication of a missing index. To help identify such cases a completed requests qualifier is automatically added that captures requests where more than 10,000 keys have been returned by sequential scans. (The "~qualifier" field in completed_requests indicates the reason the request was captured.) Statistics on sequential scan usage are also available in request profiling information.
The section "Indexes" should/must be modified to remove the sentence:
In order to make a keyspace queryable, it must have at least one index defined.
as this is no longer true.
Attachments
Issue Links
- is caused by
-
MB-52184 Add support for unindexed scanning of data.
- Closed
-
MB-57519 [Trinity Reverify]: Add support for unindexed scanning of data.
- Closed
- relates to
-
DOC-11829 Need to document that Query Sequential Scan is controlled by RBAC role
- Resolved
-
DOC-10559 SDK Doc Support for KV Range Scan
- Closed
-
DOC-11171 Manage and monitor Query Sequential Scan
- Resolved
-
AV-45746 Loading...