Morning,
Is a where clause applied to a data set before or after the join operation in the subquery bellow.
update Llyods_dedupe_template
set comp_add_dupe='T'
where key1 in
(select B.key1 from Llyods_dedupe_template A
left join Llyods_dedupe_template B on
A.gr_id1=B.gr_id1 and A.gr_id2=B.gr_id2 and A.gr_id3=B.gr_id3
where A.gr_id1!='00000000' and a.gr_id2!='00000000' and a.gr_id3!='00000000' and
A.source in ('LLYODS') and
B.source in ('CONDTU','CON-top150k','CORPD','THOM'))
The reason I ask is becuase if I remove all records that have a gr_id='00000000', the query executes in under 10 minutes.
Leaving the records within the table gives an estimated cost for the query of 329. It has been running for 21 hours now without completing.
My thinking is that the join operation is being performed for all records that have gr_id's of '00000000', which is 568664. That's a lot of joins.
Can anyone suggest what is happening here?
Regards,
Geezza
Is a where clause applied to a data set before or after the join operation in the subquery bellow.
update Llyods_dedupe_template
set comp_add_dupe='T'
where key1 in
(select B.key1 from Llyods_dedupe_template A
left join Llyods_dedupe_template B on
A.gr_id1=B.gr_id1 and A.gr_id2=B.gr_id2 and A.gr_id3=B.gr_id3
where A.gr_id1!='00000000' and a.gr_id2!='00000000' and a.gr_id3!='00000000' and
A.source in ('LLYODS') and
B.source in ('CONDTU','CON-top150k','CORPD','THOM'))
The reason I ask is becuase if I remove all records that have a gr_id='00000000', the query executes in under 10 minutes.
Leaving the records within the table gives an estimated cost for the query of 329. It has been running for 21 hours now without completing.
My thinking is that the join operation is being performed for all records that have gr_id's of '00000000', which is 568664. That's a lot of joins.
Can anyone suggest what is happening here?
Regards,
Geezza