I have problem with inner join optimalization, query:
SELECT `transaction_accounts`.`date`, `transaction_accounts`.`amount`, `transaction_accounts`.`refund`, `transaction_accounts`.`lid`, `loans`.`signatureNumber`, `transaction_accounts`.`identified` FROM `transaction_accounts` INNER JOIN `loans` ON `loans`.`lid` = `transaction_accounts`.`lid` WHERE `transaction_accounts`.`identified` != `transaction_accounts`.`date` ORDER BY `transaction_accounts`.`date`;
EXPLAIN:
|id|select_type|table|type|possible_keys|key|key_l en|ref|row s|Extra |
|1|SIMPLE|loans|ALL|PRIMARY|NULL|NULL|NULL|2440|Us ing temporary;Using filesort|
|1|SIMPLE|transaction_accounts|ref|lid|lid|3|tommy stachi.loa ns.lid 10|Using where|
I want change using temporary and using filesort, but I have no idea how can I do
SELECT `transaction_accounts`.`date`, `transaction_accounts`.`amount`, `transaction_accounts`.`refund`, `transaction_accounts`.`lid`, `loans`.`signatureNumber`, `transaction_accounts`.`identified` FROM `transaction_accounts` INNER JOIN `loans` ON `loans`.`lid` = `transaction_accounts`.`lid` WHERE `transaction_accounts`.`identified` != `transaction_accounts`.`date` ORDER BY `transaction_accounts`.`date`;
EXPLAIN:
|id|select_type|table|type|possible_keys|key|key_l en|ref|row s|Extra |
|1|SIMPLE|loans|ALL|PRIMARY|NULL|NULL|NULL|2440|Us ing temporary;Using filesort|
|1|SIMPLE|transaction_accounts|ref|lid|lid|3|tommy stachi.loa ns.lid 10|Using where|
I want change using temporary and using filesort, but I have no idea how can I do
Comment