I have the following MYSQL query.
SELECT
COUNT(analyzer_host.server) AS count,
analyzer_host.server AS server
FROM
analyzer_host,
analyzer_url,
analyzer_code
WHERE
analyzer_host.server IS NOT NULL
AND analyzer_host.server != ''
AND analyzer_code.account_id = 33
AND analyzer_code.id = analyzer_url.url_id
AND analyzer_url.id = analyzer_host.url_id
GROUP BY analyzer_host.server;
I did some profiling on this query and this is stuck in "Copying to tmp table" . Is there a way I can avoid that. Also any pointers in what is causing the query to create tmp tables.