Hi Guys,
My problem below, i think the problem is my INNER JOIN snippet, how to optimize?
Query Condition: sitename
Query Target: graph_path
SQL:
Inner Join:
SELECT graph.graph_path
FROM sites
INNER JOIN inventory on (sites.id = inventory.site_id)
INNER JOIN host on (host.inventory_id = inventory.id)
INNER JOIN graph on (graph.host_id = host.id)
WHERE sites.sitename = '10071';
Results:
1 rows in set (2.74 sec)
Explain:
Nested:
SELECT graph_path
FROM graph
WHERE host_id = (select id from host where inventory_id = (select id from inventory where site_id = (select id from sites where sitename = '10071')));
Results:
1 row in set (0.03 sec)
Explain:

explainoutput of both - Drew