Hello all,
I have a sql to tune for better performance.
I want a distinct record on few fields in a table1, and also, the distinct records does not exist in table2. I have SQL like this.
select distinct id
,dob
,file_name
from table1
where not exists(select id from table2
where table2.id=table1.id
and table2.dob=table1.dob
and table2.file_name=table1.file_name);
These tables have millions of records, and it is executing for a long time.
Could you please let me know how to increase performance for this sql? I created indexes for all the fields in the where clause.
Thank you.