Return-Path: Delivered-To: apmail-db-derby-user-archive@www.apache.org Received: (qmail 88643 invoked from network); 5 Oct 2008 20:04:09 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 5 Oct 2008 20:04:09 -0000 Received: (qmail 78652 invoked by uid 500); 5 Oct 2008 20:04:07 -0000 Delivered-To: apmail-db-derby-user-archive@db.apache.org Received: (qmail 78624 invoked by uid 500); 5 Oct 2008 20:04:07 -0000 Mailing-List: contact derby-user-help@db.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: List-Id: Reply-To: "Derby Discussion" Delivered-To: mailing list derby-user@db.apache.org Received: (qmail 78613 invoked by uid 99); 5 Oct 2008 20:04:07 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 05 Oct 2008 13:04:07 -0700 X-ASF-Spam-Status: No, hits=0.3 required=10.0 tests=DNS_FROM_DOB,DNS_FROM_SECURITYSAGE,RCVD_IN_DNSWL_LOW,RCVD_IN_DOB,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of gcaddu-derby-user@m.gmane.org designates 80.91.229.2 as permitted sender) Received: from [80.91.229.2] (HELO ciao.gmane.org) (80.91.229.2) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 05 Oct 2008 20:03:04 +0000 Received: from list by ciao.gmane.org with local (Exim 4.43) id 1KmZpI-0003js-Ni for derby-user@db.apache.org; Sun, 05 Oct 2008 20:03:36 +0000 Received: from host86-142-119-2.range86-142.btcentralplus.com ([86.142.119.2]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sun, 05 Oct 2008 20:03:36 +0000 Received: from tdudgeon by host86-142-119-2.range86-142.btcentralplus.com with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sun, 05 Oct 2008 20:03:36 +0000 X-Injected-Via-Gmane: http://gmane.org/ To: derby-user@db.apache.org From: Tim Dudgeon Subject: Slow performance of select count(*) from a_table Date: Sun, 05 Oct 2008 21:01:51 +0100 Lines: 6 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: host86-142-119-2.range86-142.btcentralplus.com User-Agent: Thunderbird 2.0.0.17 (Windows/20080914) Sender: news X-Virus-Checked: Checked by ClamAV on apache.org I have a large table (24 million rows) and getting the row count with select count(*) from a_table is taking about 50 seconds. This seems surprising to me. Surely Derby is not going through every row and counting them? Tim