Ciao.

Secondo voi questa query è ottimizzabile ?

Le tbl_def contiene più di 5.000 records mentre la tbl_temp ne può contenere al max 300 e quando la lancio si impalla il server per diversi minuti...


codice:
SELECT tbl_temp.CID, tbl_def.CID
	FROM tbl_def RIGHT JOIN tbl_temp ON tbl_def.CID = tbl_temp.CID
	WHERE tbl_def.CID Is Null;
Il database è MySQL.

Grazie a chi potrà aiutarmi.