Need help with making with making mysql query much faster.
mysql query does one loop +
within the loop 2 extra queries are done.
mysql query is executed from PHP page.
I want the query to be nearly as fast as executing the (main) mysql query directly from the mysql client (9000 records in 9 seconds)