CouchDB map-reduce allows a lot of expensive processing.
CouchDB (map-reduce) views are more like CREATE INDEX than they are SELECT FROM .
In particular, CouchDB ensures that the card function runs only once per document. (Well, actually once per document revision ever.) This is what an "iterative abbreviation map" is.
Therefore, suppose you had 10,000 documents and they process 1 second each (which is much higher than I have ever seen). It is 10,000 seconds or 2,8 hours to completely build the performance. However, as soon as the presentation is completed, a request for any line ( ?key=... ) or a line cut ( ?startkey=...&endkey=... ) is executed at the same time as a request for documents directly. Search time - O (log n) for the number of documents.
In other words, even if it takes 1 second for each document to complete the card, it takes several milliseconds to get the result. (Of course, the view should be built first, since it is actually an index.)
Jason smith
source share