View
Table of Contents
Overview
Views
belong to adesign document
.Design documents
belong to abucket
.View
names must be specified using one or moreUTF-8
characters.- All the
views
within a singledesign document
are updated when the update to a singleview
is triggered. - Expired
documents
may still exist within the index. Views
are updated incrementally.Index
queries are always accessed from disk; Keep some RAM reserved for your operating system to allocate filesystem cache- Mostly,
Views
are CPU intensive (for indexing) - All
views
are output in a sorted order according to the content and structure of the key. Keys using a numeric value are sorted numerically, forstrings
,UTF-8
is used.
How-to
Reference
maxParallelIndexers
- Each
design document
maps to oneindexer
- Couchbase Server limits the maximum number of
indexers
that can run in parallel. - There are two types of indexers:
main indexers
andreplica indexers
. - Default is
4
(main),2
(replica) - Can be modified by setting
maxParallelIndexers
andmaxParallelReplicaIndexers
Couchbase makes no recommendations for tuning beyond the default settings.
# Check current indexer tasks
curl -X GET -u Administrator:password http://localhost:8092/_active_tasks
# Get / Set maxParallelIndexers
curl -X GET -u Administrator:password http://localhost:8091/settings/maxParallelIndexers
curl -X POST -u Administrator:password http://localhost:8091/settings/maxParallelIndexers -d 'globalValue=8'
# Check current internalSettings
curl -x GET -u Administrator:password http://localhost:8091/internalSettings
Topics
Index updates
stale=ok
- The current index is used as the basis for the query and the results are returned accordingly.
stale=false
- The index is updated before you execute the query
- The response will be delayed until the updated index is available.
stale=updateafter
Index
is marked for updating once the results have been returned to the client
Automated index updates
- At every
updateInterval
(default:5000ms
), theviews
engine checks if the number of document mutations on disk is greater thanupdateMinChanges
(default:5000
). If true, it triggers the view update. - If
updateMinChanges
is set to0
, automatic updates are disabled. - There are also options for replica(like
replicaUpdateMinChanges
).