> >>Do I need to make a special index to index time on HOUR?  
> Is it even  
> >>possible?
> > 
> > I believe the index on time will work for this.
> 
> No, it won't.  At least, not with the query as is:
> 
>    SELECT * FROM logs
>    WHERE host IN ('10.20.254.5')
>      AND date='2005-02-03'
>      AND HOUR(time) BETWEEN '16' AND '17'
>    ORDER BY seq  DESC;
> 
> Once you feed a column through a function, you prevent use of 
> its index. 

Yep my fault, meant to explain that the query should be changed. I thought I
did that above when I suggested adding the index for the first query, but I
obviously did not.

---
Tom Crimmins
Interface Specialist
Pottawattamie County, Iowa

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

Reply via email to