CouchDB related problems
Opened this issue · 3 comments
Comment from mailing list:
Hi Francesco,
CouchDB stores JSON in a native erlang format on disk. Retrieving this
(whether to process in a JS map/reduce view, or to send through to an
http client) requires transforming this into JSON text format. For big
docs, this can take a while, or even when piped into couchjs, break.
There's a couple of other people who have reported this type of issue
recently on the ML.
You could avoid this by using erlang views**, or you may check whether
you see the same issue in 1.1.1 which has a different (slower) JSON
parsing tool.
Could you open a JIRA ticket for this issue please, seeing as you have
a nice sample doc to share?
Some general points:
typically you can replace emit(doc.id, doc) with emit(null) in your view.
You can always use ?include_docs=true to return the full data files in
your query.
The id of any doc emitted is available "for free" so you don't need
the duplication.
This will make your view significantly smaller by orders of magnitude.
** erlang views run inside the erlang vm, without a trusted sandbox rm
-rf and worse are all possible. But its likely faster, less
limitations per above issue, and comes with less documentation too.
YMMV, don't forget to wear a seatbelt, and never ever run with
scissors.
A+
Dave