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, <[EMAIL PROTECTED]> 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


-- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]



Reply via email to