Automated index updates performance impact

Hi,

We are calling view with STALE_AFTER, it gives us result immediately and starts building view after that call.
We are having just 100 documents that why are getting just ZERO result and calling the view again gives 100 result.

Since couchbase configuration is
{
“updateInterval”:5000,
“updateMinChanges”:5000,
“replicaUpdateMinChanges”:5000
}
Our view automatically get updated after 5 sec only if there is 5000 changes.
We will change the updateMinChanges to 1, so that on each/single document update, Our view Index update get started.

So Is there any performance impact to couchbase due to this change.

@sawan , if the min changes is set to 1 the query as well as the index build performance will be bad. view-engine internally uses append only design for its index files. The btree updates are efficient for bulk updates since it will result only in writing a single snapshot. If we were to do use single btree operation per item, it will result in that many snapshot being created and lot of storage space being consumed. Due to this Fragmentation of the index file will also increase and compactor will run every-time it reaches fragmentation threshold and in this case it will run frequently.