Return-Path: Delivered-To: apmail-ibatis-user-java-archive@www.apache.org Received: (qmail 17146 invoked from network); 17 Jun 2005 05:03:29 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 17 Jun 2005 05:03:29 -0000 Received: (qmail 44898 invoked by uid 500); 17 Jun 2005 05:03:27 -0000 Delivered-To: apmail-ibatis-user-java-archive@ibatis.apache.org Received: (qmail 44876 invoked by uid 500); 17 Jun 2005 05:03:27 -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 44862 invoked by uid 99); 17 Jun 2005 05:03:27 -0000 X-ASF-Spam-Status: No, hits=0.1 required=10.0 tests=FORGED_RCVD_HELO X-Spam-Check-By: apache.org Received-SPF: pass (hermes.apache.org: local policy) Received: from 68-97-89-203-static.vic.ipn.net.au (HELO conads.com) (203.89.97.68) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 16 Jun 2005 22:03:27 -0700 Received: from [220.244.112.202] (account zoran HELO [10.0.1.3]) by conads.com (CommuniGate Pro SMTP 4.2.3) with ESMTP id 424172; Fri, 17 Jun 2005 15:03:09 +1000 User-Agent: Microsoft-Entourage/11.1.0.040913 Date: Fri, 17 Jun 2005 15:03:10 +1000 Subject: Re: OT: COUNT query speed issue From: Zoran Avtarovski To: , Larry Meadors Message-ID: In-Reply-To: Mime-version: 1.0 Content-type: text/plain; charset="US-ASCII" Content-transfer-encoding: 7bit X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Thanks for the suggestion Larry, That's exactly what I was thinking, but I guess I was concerned that it was overkill. Do you know if there are some example approaches or methodologies I can read up on. Z. > Is this historical data? What I mean by that is, does it change frequently? > > 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. >> >> Z. >> >> >>