List:General Discussion« Previous MessageNext Message »
From:Brent Baisley Date:November 4 2003 10:32pm
Subject:Re: query time in ~3M row table
View as plain text  
You're searching on a calculation so I'm pretty sure that MySQL is not 
using an index for the search. You should use explain in front of your 
query to see if MySQL is using indexes. You do have that date field 
indexed, don't you?
You should search on ApacheDate between 9/1/2003 and 10/1/2003.

Something like this:
select count(*) from hitstats where apacheData between '2003-09-01' and 
'2003-10-01';

I think that's right. The 'between' is not inclusive of the second 
parameter.

On Tuesday, November 4, 2003, at 05:09 PM, <jabbott@stripped> wrote:

> When I try to do any sort of query the times are really long.  Such as:
>
> mysql> select count(*) from hitstats where year(apacheDate) = 2003 and
> month(apacheDate) = 9;                               +----------+
> | count(*) |
> +----------+
> |   988759 |
> +----------+
> 1 row in set (25.17 sec)
>
-- 
Brent Baisley
Systems Architect
Landover Associates, Inc.
Search & Advisory Services for Advanced Technology Environments
p: 212.759.6400/800.759.0577

Thread
query time in ~3M row tablejabbott4 Nov
  • Re: query time in ~3M row tableBrent Baisley4 Nov
    • Re: query time in ~3M row tablejabbott5 Nov
      • Re: query time in ~3M row tableMatt W5 Nov
        • Re: query time in ~3M row tableBrent Baisley5 Nov
          • Re: query time in ~3M row tableDan Nelson5 Nov
            • Re: query time in ~3M row tableBrent Baisley5 Nov
      • Re: query time in ~3M row tableBrent Baisley5 Nov
      • Re: query time in ~3M row tableMatt W5 Nov
  • Re: query time in ~3M row tableDan Nelson5 Nov