Hallo, ich habe folgenden SELECT Befehl nur leider dauert der bei mir ewig lang bei der der ausführung hat jemand eine Idee wie ich diesen SQL-Befehl tunen kann?
Vorschläge, Ideen?
Code:
SELECT s.spot, s.x, s.y, s.width, s.height, r.part_id, r.part_nr, r.position, d.descr, p.pos, r.amount, COUNT(*), r.is_group, t.id, t.parent, t2.field_value FROM Spots AS s LEFT JOIN PartSpots AS p ON (s.spot = p.spot) LEFT JOIN SpareParts AS r ON (p.pos_id = r.pos_id) LEFT JOIN ElementDesc AS d ON r.pos_id = d.id_value AND d.tab_name = 'SpareParts AND d.language = 'GER') LEFT JOIN PartSpots AS p2 ON (s.spot = p2.spot) LEFT JOIN SparePartsTree AS t On (t.field_value = r.pos_id AND (t.level = 'part_group' || t.level = 'part')) LEFT JOIN SparePartsTree AS t2 ON (t.parent = t2.id) WHERE file_id = 45 GROUP BY s.spot, s.x, s.y, s.width, s.height, r.part_id, r.part_nr, r.position, d.descr, p.pos_id, r.amount ORDER BY r.position, r.part_nr, r.part_id
Kommentar