The following SQL is very slow
SELECT `id`,`time` from song? where? `song`.`genre` = $item and not `song`.`artist` in (SELECT `song`.`artist` FROM `schedule` inner join `song` WHERE `schedule`.`item` = `song`.`id` and `schedule`.`time` > ($tracktime-3600))? ORDER BY RAND() LIMIT 1;
What I would like to do is get rid if the in part
It runs 30 times every hour and takes about 2 mins to run each time