Hi
There are two tables
Table 1 :
final_account_bbs_tm
Table 2:
apgvb_csp_cus_mapping
same column in both table
global_account_num
I want records for table final_account_bbs_tm which does not exist in table
global_account_num for column global_account_num
Following is the query But it take so long long hours and finally too much load on mysql
Code:
select fa.global_account_num , asm.global_account_num
from final_account_bbs_tm fa LEFT OUTER JOIN
apgvb_csp_cus_mapping asm ON fa.global_account_num=asm.global_account_num
where asm.global_account_num is null;
Its EXPLAIN output
*************************** 1. row ***************************
id: 1
select_type: SIMPLE
table: fa
type: index
possible_keys: NULL
key: global_account_num
key_len: 303
ref: NULL
rows: 1272300
Extra: Using index
*************************** 2. row ***************************
id: 1
select_type: SIMPLE
table: asm
type: index
possible_keys: NULL
key: global_account_num_id1
key_len: 53
ref: NULL
rows: 1114569
Extra: Using where; Using index
Is there any other way to get same result in efficient way