more efficient CouchDB view