2

i have a couchdb with a database containing ~20M documents. it takes ~12h to build a single view.

i have saved 6 views successfully. they returned results quickly. at first.

after 2 days idle, i added another view. it took much longer to build, and it was a "nice-to-have", not a requirement, so i killed it after ~60% completion (restarted the windows service).

my other views now start re-building their indexes when accessed.

really frustrated.

additional info: disk had gotten within 65GB of full (1TB disk; local)

1 Answers1

1

Sorry you have no choice but to wait for the views to rebuild here. However I will try to explain why this is happening. It won't solve your problem but perhaps it will help you understand what is happening and how to prevent it in future.

From the wiki

CouchDB view index filenames are based on the contents of the design document (not its name, ID or revision). This means that two design documents with identical view code will share view index files.

What follows is that if you change the contents by adding a new view or updating the existing one couchdb will rebuild the indexes.

So I think the most obvious solution is to add new views in new design docs. It will prevent re indexing of existing views and the new one will take whatever time it needs to index any way.

Here is another helpful answer that throws light on how to effectively use couchdb design documents and views.

Community
  • 1
  • 1
Akshat Jiwan Sharma
  • 15,430
  • 13
  • 50
  • 60
  • that also explains why only the design document shows up in the "object" column on the status page of the browser utility – user3812702 Jul 07 '14 at 15:36
  • and, it *also* explains why running several indexes in parallel under the same design document is so slow. – user3812702 Jul 07 '14 at 15:38