You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@couchdb.apache.org by Matthias Eck <ma...@gmail.com> on 2012/06/01 01:40:16 UTC

View access during indexing

Hello,

One of my databases in CouchDB has close to 1,000,000 documents with a
size of about 200GB.
If I change one of the views, the indexing takes about 2 hours.

This time would be not a problem, but I am wondering why I cannot
access the other views, that were previously generated during the
indexing time.
Currently none of the views is available, taking my web application
down during this time.

Is there a parameter that can be adjusted to allow view access during indexing?

Thanks,
Matthias

Re: View access during indexing

Posted by Jim Klo <ji...@sri.com>.
It should be limited to views within a single design doc.  There's some storage efficiency I think for placing all your views into a single design doc, but all views in a design doc get rebuilt when you modify any of the views.

If your views aren't dependent upon each other, and you aren't concerned about disk utilization, you could create each view in a separate design doc to bypass the rebuild.  Other 'hackery' that I understand is possible is to push the modified view to a copy of the design doc with a different _id and begin the index process (query the last document in the view). Then once the indexing is complete, update the original design doc to match the alternate and CouchDb should assume using the view that was 'backgrounded'. This will keep all views accessible until you swap in the changes after the modified view is indexed.

- Jim

Jim Klo
Senior Software Engineer
Center for Software Engineering
SRI International

On May 31, 2012, at 4:40 PM, Matthias Eck wrote:

> Hello,
> 
> One of my databases in CouchDB has close to 1,000,000 documents with a
> size of about 200GB.
> If I change one of the views, the indexing takes about 2 hours.
> 
> This time would be not a problem, but I am wondering why I cannot
> access the other views, that were previously generated during the
> indexing time.
> Currently none of the views is available, taking my web application
> down during this time.
> 
> Is there a parameter that can be adjusted to allow view access during indexing?
> 
> Thanks,
> Matthias


Re: View access during indexing

Posted by "Kevin R. Coombes" <ke...@gmail.com>.
If possible, you might also want to consider putting each view in a 
separate design document; while one view is rebuilding, you shoudl still 
be able to access views that are part of a different design.

On 6/6/2012 6:55 AM, Nils Breunese wrote:
> Matthias Eck wrote:
>
>> One of my databases in CouchDB has close to 1,000,000 documents with a
>> size of about 200GB.
>> If I change one of the views, the indexing takes about 2 hours.
>>
>> This time would be not a problem, but I am wondering why I cannot
>> access the other views, that were previously generated during the
>> indexing time.
>> Currently none of the views is available, taking my web application
>> down during this time.
>>
>> Is there a parameter that can be adjusted to allow view access during indexing?
> I suggest adding an updated design document under a new name, run the view indexing on that one and switching over the design document to the production location afterwards. See http://wiki.apache.org/couchdb/How_to_deploy_view_changes_in_a_live_environment for some more details.
>
> Nils.
> ------------------------------------------------------------------------
>   VPRO   www.vpro.nl
> ------------------------------------------------------------------------

Re: View access during indexing

Posted by Nils Breunese <N....@vpro.nl>.
Matthias Eck wrote:

> One of my databases in CouchDB has close to 1,000,000 documents with a
> size of about 200GB.
> If I change one of the views, the indexing takes about 2 hours.
>
> This time would be not a problem, but I am wondering why I cannot
> access the other views, that were previously generated during the
> indexing time.
> Currently none of the views is available, taking my web application
> down during this time.
>
> Is there a parameter that can be adjusted to allow view access during indexing?

I suggest adding an updated design document under a new name, run the view indexing on that one and switching over the design document to the production location afterwards. See http://wiki.apache.org/couchdb/How_to_deploy_view_changes_in_a_live_environment for some more details.

Nils.
------------------------------------------------------------------------
 VPRO   www.vpro.nl
------------------------------------------------------------------------