Return-Path: Delivered-To: apmail-ibatis-user-java-archive@www.apache.org Received: (qmail 7255 invoked from network); 17 Jun 2005 04:24:07 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 17 Jun 2005 04:24:07 -0000 Received: (qmail 85309 invoked by uid 500); 17 Jun 2005 04:24:05 -0000 Delivered-To: apmail-ibatis-user-java-archive@ibatis.apache.org Received: (qmail 85283 invoked by uid 500); 17 Jun 2005 04:24:04 -0000 Mailing-List: contact user-java-help@ibatis.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user-java@ibatis.apache.org Delivered-To: mailing list user-java@ibatis.apache.org Received: (qmail 85260 invoked by uid 99); 17 Jun 2005 04:24:04 -0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests=RCVD_BY_IP X-Spam-Check-By: apache.org Received-SPF: pass (hermes.apache.org: domain of larry.meadors@gmail.com designates 64.233.162.204 as permitted sender) Received: from zproxy.gmail.com (HELO zproxy.gmail.com) (64.233.162.204) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 16 Jun 2005 21:24:04 -0700 Received: by zproxy.gmail.com with SMTP id 18so264536nzp for ; Thu, 16 Jun 2005 21:23:49 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:reply-to:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=Jv95UeRRddcShmLRinYvapamKql6cA0B0PK33TCpjfR5h5bYogazHnWnFTTuOh8WaAk9BEzzRpo8fWTxP9wi14PJYLBiyNZsUGI6na6C/gi8SBMQwKZ5jkSMt+Uyyn1Ez1i32FDvOZ57qrkOuxIMcWcDyTq7sHfdaE3pm9b3QCE= Received: by 10.36.103.11 with SMTP id a11mr1003584nzc; Thu, 16 Jun 2005 20:57:09 -0700 (PDT) Received: by 10.36.90.14 with HTTP; Thu, 16 Jun 2005 20:57:09 -0700 (PDT) Message-ID: Date: Thu, 16 Jun 2005 21:57:09 -0600 From: Larry Meadors Reply-To: lmeadors@apache.org To: user-java@ibatis.apache.org Subject: Re: OT: COUNT query speed issue In-Reply-To: Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline References: <20050617031547.33586.qmail@web32203.mail.mud.yahoo.com> X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Is this historical data? What I mean by that is, does it change frequently?= =20 If not, maybe a better approach would be to periodically create a table with the data in a summarized form. >From the original email, it sounds like this approach may work for data where the log_time is before today, but maybe not for today's data. If that is the case, you could union the two queries (one over the historical data, and one over the live data for today). Larry On 6/16/05, Zoran Avtarovski wrote: > > Do things get faster if you have the database index remote_id and > > log_time? > > > The log_time column is indexed, but I couldn't work out how to index two > columns in mysql. >=20 > Z. >=20 >=20 >