Return-Path: X-Original-To: apmail-couchdb-commits-archive@www.apache.org Delivered-To: apmail-couchdb-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 39D8996F0 for ; Tue, 6 Dec 2011 10:13:38 +0000 (UTC) Received: (qmail 14757 invoked by uid 500); 6 Dec 2011 10:13:38 -0000 Delivered-To: apmail-couchdb-commits-archive@couchdb.apache.org Received: (qmail 14626 invoked by uid 500); 6 Dec 2011 10:13:36 -0000 Mailing-List: contact commits-help@couchdb.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@couchdb.apache.org Delivered-To: mailing list commits@couchdb.apache.org Received: (qmail 14615 invoked by uid 500); 6 Dec 2011 10:13:36 -0000 Delivered-To: apmail-incubator-couchdb-commits@incubator.apache.org Received: (qmail 14611 invoked by uid 99); 6 Dec 2011 10:13:35 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 06 Dec 2011 10:13:35 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.131] (HELO eos.apache.org) (140.211.11.131) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 06 Dec 2011 10:13:32 +0000 Received: from eos.apache.org (localhost [127.0.0.1]) by eos.apache.org (Postfix) with ESMTP id 5464CD0; Tue, 6 Dec 2011 10:13:10 +0000 (UTC) MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable From: Apache Wiki To: Apache Wiki Date: Tue, 06 Dec 2011 10:13:10 -0000 Message-ID: <20111206101310.79794.40278@eos.apache.org> Subject: =?utf-8?q?=5BCouchdb_Wiki=5D_Update_of_=22FUQ=22_by_DaveCottlehuber?= Auto-Submitted: auto-generated X-Virus-Checked: Checked by ClamAV on apache.org Dear Wiki user, You have subscribed to a wiki page or wiki category on "Couchdb Wiki" for c= hange notification. The "FUQ" page has been changed by DaveCottlehuber: http://wiki.apache.org/couchdb/FUQ?action=3Ddiff&rev1=3D2&rev2=3D3 Comment: reducing the number of FUQups =3D=3D Views =3D=3D = 1. In a view, why should I not {{{emit(key,doc)}}} ? + The key point here is that by emitting {{{,doc}}} you are duplicating t= he document which is already present in the database (a .couch file), and i= ncluding it in the results of the view (a different .couch file, with simil= ar structure). This is the same as having a SQL Index that includes the ori= ginal table, instead of using a foreign key. + = The same effect can be acheived by using {{{emit(key,null)}}} and ?incl= ude_docs=3Dtrue with the view request. This approach has the benefit of not= duplicating the document data in the view index, which reduces the disk sp= ace consumed by the view. On the other hand, the file access pattern is sli= ghtly 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. + = 1. What happens if I don't ducktype the variables I am using in my view? 1. Does it matter if my map function is complex, or takes a long time to= run? = =3D=3D Tools =3D=3D = - 1. I decided to roll my own !CouchApp tool or !CouchDB client in . How cool is that? + 1. I decided to roll my own !CouchApp tool or CouchDB client in . How cool is that? + Pretty cool! In fact its a great way to get familiar with the API. How= ever - wrappers around the HTTP API are not necessarily of great use as Cou= chDB already makes this very easy. Mapping CouchDB semantics onto your lang= uage's native data structures is much more useful to people. Many languages= are already covered and we'd really like to see your ideas and enhancement= s incorporated into the existing tools if possible, and helping to keep the= m up to date. Ask on the mailing list about contributing! = + =3D=3D Log Files =3D=3D + 1. Those Erlang messages in the log are pretty confusing. What gives? + Erlang kindly provides us with a stack trace. In many cases, this is e= nough to identify the problem. For example, OS errors are reported as tagge= d tuples {{{{error,enospc}}}} or {{{{error,enoacces}}}} which respectively = is "You ran out of disk space", and "CouchDB doesn't have permission to acc= ess that resource". Most of these errors are derived from C used to build t= he Erlang VM and are documented in {{{errno.h}}} and related header files. = [[http://www.ibm.com/developerworks/aix/library/au-errnovariable/|IBM]] pro= vides a good introduction to these, and the relevant [[http://pubs.opengrou= p.org/onlinepubs/9699919799/basedefs/errno.h.html|POSIX]] and [[http://www.= gnu.org/s/hello/manual/libc/Error-Codes.html|GNU]] and [[http://msdn.micros= oft.com/en-us/library/5814770t.aspx|Microsoft Windows]] standards will cove= r most cases. +=20