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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Performance Issue

Status
Not open for further replies.

Swi

Programmer
Feb 4, 2002
1,963
0
36
US
I am calling this SQL statement on my Access database using VB. However It is extremely SLOW.

Code:
DELETE *
FROM tblMain
WHERE tblMain.[Phone Number] Not In (Select tblSub.[Phone Number] from tblSub)

Any ideas on how to speed things up?

Thanks.

Swi
 
Do you have a large number of records in [tt]tblMain[/tt]? [tt]tblSub[/tt]?
By 'large', I mean - millions?


---- Andy

There is a great need for a sarcasm font.
 
Hi, yes, both indexed and a few hundred thousand in tblMain and a few million in tblSub.

Thanks.

Swi
 
Is the [Phone Number] unique in tblSub? If not, I would try run a make table query with unique phone numbers and make the phone number primary. Then use the new table rather than tblSub.

Otherwise since there are so many records, I would maybe try batches of records or a LEFT JOIN.

Millions of records in Access will take some time.

Duane
Minnesota
Hook'D on Access
MS Access MVP 2001-2016
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top