When performing a bulk update, how much time should I expect for view
generation for views that do not index the documents that I am updating?
For example:
I have a single view which is the only view in the design document. The
view has the map function
if (doc.type == 'Foo') {
emit(doc.name, doc.age);
}
and no reduce function.
I then add 8000 documents where doc.type == 'Bar'
When I access the view the first time , it takes about 7 to 8 seconds to
generate even though nothing is emitted. Of course, subsequent accesses to
the view are much faster.
I know that I can mitigate by querying the view after adding every couple
of hundred documents but it surprises me that a generate takes this long
when all that is happening is an if-condition being checked.
Is this to be expected or is there a better way to structure the view?
Thanks,
Jason