Return-Path: X-Original-To: apmail-couchdb-dev-archive@www.apache.org Delivered-To: apmail-couchdb-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id E39939CCF for ; Tue, 26 Feb 2013 16:09:29 +0000 (UTC) Received: (qmail 77354 invoked by uid 500); 26 Feb 2013 16:09:29 -0000 Delivered-To: apmail-couchdb-dev-archive@couchdb.apache.org Received: (qmail 77267 invoked by uid 500); 26 Feb 2013 16:09:29 -0000 Mailing-List: contact dev-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 dev@couchdb.apache.org Delivered-To: moderator for dev@couchdb.apache.org Received: (qmail 44193 invoked by uid 99); 26 Feb 2013 14:37:13 -0000 X-ASF-Spam-Status: No, hits=2.5 required=5.0 tests=FREEMAIL_ENVFROM_END_DIGIT,SPF_SOFTFAIL,URI_HEX X-Spam-Check-By: apache.org Received-SPF: softfail (nike.apache.org: transitioning domain of karimaben_1@hotmail.com does not designate 216.139.250.139 as permitted sender) Date: Tue, 26 Feb 2013 06:36:46 -0800 (PST) From: sheira To: dev@couchdb.apache.org Message-ID: <1361889406270-7583314.post@n2.nabble.com> Subject: slow access to couchdb MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org Hi, I use CouchDB in my Zend website and i'm really surprise cause I use this code to recover the good record and it's so slow(150 records recovered in 5 minutes!) So here is my code : $this->view->couchData = array(); foreach ($this->view->arrayPostes as $k => $v) { $poste = PosteLogCouch::getPoste($v['poste_id']); $this->view->couchData[$v['poste_id']]->detailsViews = $poste->detailsViews; $this->view->couchData[$v['poste_id']]->resumeViews = $poste->resumeViews; $this->view->couchData[$v['poste_id']]->detailsMonthViews = $poste->detailsMonthViews; $this->view->couchData[$v['poste_id']]->resumeMonthViews = $poste->resumeMonthViews; $this->view->couchData[$v['poste_id']]->appliants = $poste->appliants; $this->view->couchData[$v['poste_id']]->monthAppliants = $poste->monthAppliants; } and here is my PosteLogCouch Class: detailsViews++; $poste->detailsMonthViews++; } function resumeView($id) { $poste = self::getPoste($id); $poste->resumeViews++; $poste->resumeMonthViews++; } function appliant($id) { $poste = self::getPoste($id); $poste->appliants++; $poste->monthAppliants++; } function getPoste($id) { $couchClient = Zend_registry::get('couchdb_client'); try { $couchClient->asCouchDocuments(); $annonce = $couchClient->getDoc('Poste'.$id); } catch (couchException $e) { if ($e->getCode() == '404') { $annonce = new Cwl_Couch_Model($couchClient); $annonce->_id = 'Poste'.$id; } } self::checkMonth($annonce); return $annonce; } protected function checkMonth($poste) { $month = date('n'); if ($poste->month != $month) { $poste->month = $month; $poste->detailsMonthViews = 0; $poste->resumeMonthViews = 0; $poste->monthAppliants = 0; return false; } return true; } } Can we please help me to solve this problem? Thanks in advance! -- View this message in context: http://couchdb-development.1959287.n2.nabble.com/slow-access-to-couchdb-tp7583314.html Sent from the CouchDB Development mailing list archive at Nabble.com.