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
I think that's right. The 'between' is not inclusive of the second
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)
Landover Associates, Inc.
Search & Advisory Services for Advanced Technology Environments