Results 1 to 5 of 5
Thread: How to optimise this query?
Feb 4, 2011, 16:14 #1
- Join Date
- Jun 2004
- 0 Post(s)
- 0 Thread(s)
How to optimise this query?
I'm trying to sort out some of my slowest queries, and here is one that takes some time, partially because it's a bit slow, but also because I run it quite often.
Anyway, my table site_articles has seperate indexes on approved (int), type (int) and created (datetime), and the only one used is created. There is however a full tablescan occurring...
SELECT id, title, created, headline FROM site_articles WHERE approved=1 AND type=0 AND id <> 14277 AND DATE(created) = DATE('20100225') ORDER BY created DESC LIMIT 15
Is there any way I can improve this one? Note that I can pass the date '20100225' in any format, so I can change that if necessary.