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] Trivial Update of "FUQ" by RandallLeeds
Date Fri, 23 Dec 2011 21:10:02 GMT
Dear Wiki user,

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

The "FUQ" page has been changed by RandallLeeds:
http://wiki.apache.org/couchdb/FUQ?action=diff&rev1=7&rev2=8

   In a view, why should I not {{{emit(key,doc)}}} ?
  
    .
-   The key point here is that by emitting {{{,doc}}} you are duplicating the document which
is already present in the database (a .couch file), and including it in the results of the
view (a different .couch file, with similar structure). This is the same as having a SQL Index
that includes the original table, instead of using a foreign key.
+   The key point here is that by emitting {{{,doc}}} you are duplicating the document which
is already present in the database (a .couch file), and including it in the results of the
view (a .view file, with similar structure). This is the same as having a SQL Index that includes
the original table, instead of using a foreign key.
  
    The same effect can be acheived by using {{{emit(key,null)}}} and ?include_docs=true with
the view request. This approach has the benefit of not duplicating the document data in the
view index, which reduces the disk space consumed by the view. On the other hand, the file
access pattern is slightly more expensive for CouchDB. It is usually a premature optimization
to include the document in the view. As always, if you think you may need to emit the document
it's always best to test.
  

Mime
View raw message