Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Finding Duplicates in large lists

Status
Not open for further replies.

lukemcc

Technical User
Nov 15, 2007
2
CA
I have a table of 75,000 username's that I need to match to another table that contains 2.5 million usernames.

Other than a simple left outer join of my 75K table to the master table I am stumped on the best way to do this.

I am on db2 9.1 and the below query has been running for a little over 4 hours. Is there a better/faster way?

select w.conuser, w.email
from(
SELECT
w.conuser,
w.email,
c.masterconFK
FROM
washingtoncon05 w
left outer join mastercontacts c on w.conuser = c.masterconFK )a
where c.masterconFK is null


Thanks!
 
Thanks Frederico,

I added an index to the tables, did a runstats and then used your query. Finished running in just a few minutes.

Thanks,
Luke
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top