Uploaded image for project: 'Couchbase Documentation'
  1. Couchbase Documentation
  2. DOC-11680

Add section on sequential scans

    XMLWordPrintable

Details

    • Improvement
    • Resolution: Fixed
    • Major
    • Trinity
    • Trinity
    • query
    • 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

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

              simon.dew Simon Dew
              Donald.haggart Donald Haggart
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes

                  PagerDuty