Do all views reindex when updating a design doc?

If I have multiple views in a design document and I modify only one view will couchbase reindex all the views or will it notice that most are unchanged and only reindex the one that changed?



Only the one that changed.

I’d hoped it would

Thanks Jens

@jens can I ask you one more thing?

In the documentation it says that design documents created through SG use rev like normal docs, however you can update an existing design doc without providing a rev, and a GET on the design doc does not provide the rev either, just the “views”.

Is there another call I’m missing to access the rev? Do they actually have a rev at all, as they don’t seem to be backed by actual documents?



The design doc calls in the SG REST API are mostly just passed through to Couchbase Server. I’m not sure how Server stores design docs, but they don’t manifest as documents in the bucket, and they don’t have revision IDs.

I guessed it was something like that, and that the documentation isn’t quite right.

Thanks again


@paulharter Can you share a link to the particular documentation you’re referring to (that suggests that design docs use rev) so that we can get it cleaned up?

@adamf in the 1.3 documentation!/query/get_db_design_ddoc

I know this is an old thread but I wanted to know the same thing. @jens said “Only the one that changed” will be updated. In the documentation, here it says:

“Because the index for each map/reduce combination within each view within a given design document is updated at the same time, avoid declaring too many views within the same design document. For example, if you have a design document with five different views, all five views will be updated simultaneously, even if only one of the views is accessed.

This contradicts Jens reply, possibly because Jens was specifically referring to SG. I’m not using SG for my bucket, so I’d like to check the correct behaviour.

The reason why I’m asking is that currently when a doc is added to the bucket, I want all the views updated in a design doc so I run a query on each view in turn to update (with limit=0 and stale=false). Do I need to do this or would it work if I ran a query on only one view in the ddoc?