Hallo, ich habe die folgende Abfrage:
SELECT count(id) AS anzahl
FROM results AS r1
WHERE r1.ip = ? AND (r1.scan_id) = (SELECT MAX(r2.scan_id) FROM results AS r2 WHERE r2.domain_id = r1.domain_id )
LIMIT 1;
Auf welche Spalten setze ich hier am besten einen Index?
Würde mich über Hilfe freuen!
Viele Grüße
Dennis