couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Apache Wiki <wikidi...@apache.org>
Subject [Couchdb Wiki] Update of "Frequently asked questions" by RobertNewson
Date Sun, 30 Aug 2009 17:11:24 GMT
Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Couchdb Wiki" for change notification.

The following page has been changed by RobertNewson:
http://wiki.apache.org/couchdb/Frequently_asked_questions

The comment on the change is:
restore slow_view_building section

------------------------------------------------------------------------------
  
  === Views ===
    * [#how_fast_views How Fast are CouchDB Views?]
+   * [#slow_view_building Creating my view index takes ages, WTF?]
    * [#update_views_more_often I want to update my view indexes more often than only when
a user reads it. How do I do that best?]
-   * [#slow_view_building Creating my view index takes ages, WTF?]
    * [#relationships How do I model relationships in CouchDB? / Where are my JOINs?]
    * [#view_share_code How do I share code/functions between views? / Why can I not?]
  
@@ -228, +228 @@

  
  The major advantage of the architecture is, however, that it is designed for high traffic.
No locking occurs is the storage module (MVCC and all that) allowing any number of parallel
readers as well as serialized writes. With replication, you can even set up multiple machines
for a horizontal scale-out and data partitioning (in the future) will let you cope with huge
volumes of data. (See [http://jan.prima.de/~jan/plok/archives/72-Some-Context.html slide 13
of Jan Lehnardt's essay] for more on the storage module or the whole post for detailed info
in general).
  
+ [[Anchor(slow_view_building)]]
+ == Creating my view index takes ages, WTF? ==
  
+ A couple of reasons:
+ 
+ 1) Your reduce function is not reducing the input data to a small enough output. See [:Introduction_to_CouchDB_views#reduce_functions]
for more details.
+ 
+ 2) If you have a lot of documents or lots of large documents (going into the millions and
Gigabytes of data, the first time a view index is created just takes the time it is needed
to run through all documents.
+ 
- 2) If you use the `emit()`-function in your view with `doc` as the second parameter you
effectively copy your entire data into the view index. This takes a lot of time. Consider
rewriting your `emit()` call to `emit(key, null);` and query the view with the `?include_docs=true`
parameter to get all doc's data with the view without having to copy the data into the view
index.
+ 3) If you use the `emit()`-function in your view with `doc` as the second parameter you
effectively copy your entire data into the view index. This takes a lot of time. Consider
rewriting your `emit()` call to `emit(key, null);` and query the view with the `?include_docs=true`
parameter to get all doc's data with the view without having to copy the data into the view
index.
  
- 3) You are using Erlang release R11B (or 5.5.x). Update to at least R12B-3 (or 5.6.3).
+ 4) You are using Erlang release R11B (or 5.5.x). Update to at least R12B-3 (or 5.6.3).
  
  [[Anchor(relationships)]]
  == How do I model relationships in CouchDB? / Where are my JOINs? ==

Mime
View raw message