I have made mysql explain the following query:
SELECT carid,pic0,bio,url,site,applet
FROM cronjob_reloaded
WHERE
carid LIKE '%bmw%'
OR
carid LIKE '%mer%'
OR
age BETWEEN '5' AND '10'
OR
category IN ('used')
ORDER BY CASE
WHEN carid LIKE '%bmw%' OR carid LIKE '%mer%' THEN 1
WHEN age BETWEEN '5' AND '10' THEN 2
ELSE 3
END
And here is the explain result:
EXPLAIN SELECT carid, pic0, bio, url, site, applet
FROM cronjob_reloaded
WHERE carid LIKE '%bmw%'
OR carid LIKE '%mer%'
OR carid IS NOT NULL
AND age
BETWEEN '5'
AND '10'
What I do not understand it this:
Why is the key NULL?
Can I make this query faster? It takes 0.0035 sec - is this slow or fast for a 1000 rows table?
In my table carid is the primary key of the table.