One for all you MySQL experts :-)
I have the following query:
SELECT o.*, p.name, p.amount, p.quantity
FROM orders o, products p
WHERE o.id = p.order_i
Use Explain to indicate how to optimise the query. I'd suggest starting with indices on Total and TimeStamp
You may find removing the date
function improves performance.
You should use modern syntax.
eg.
SELECT o.*, p.name, p.amount, p.quantity
FROM orders o
inner join products p
on o.id = p.order_id
WHERE o.total != '0.00'
AND o.timestamp BETWEEN '2012-01-01' AND '2012-01-31 23:59'
ORDER BY o.timestamp ASC