this kind of MySQL-Query is very slow at the moment.
What would be the best indices for this to speed it up? (InnoDB)
SELECT item_id,
Group_concat(storage_nr SEPARATOR ',') AS storage_nr,
Group_concat(condition SEPARATOR ',') AS condition,
Group_concat(number SEPARATOR ',') AS number,
Group_concat(price SEPARATOR ',') AS price,
last_calc
FROM items
WHERE number > 0
AND bottomlimit IS NOT NULL
AND condition IN (1, 2, 3)
AND ( price_date IS NULL
OR price_date < Date_sub(Now(), INTERVAL 1 hour) )
AND ( NOT ( price = bottomlimit
AND pricebefore = bottomlimit
AND pricebefore2 = bottomlimit )
OR price IS NULL
OR pricebefore IS NULL
OR pricebefore2 IS NULL
OR Date(price_date) <> Curdate() )
GROUP BY item_id
ORDER BY last_calc
LIMIT 20
Thanks a lot in advance!
Best regards!