Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Alternative to Subquery

Author  Topic 

cr8nk
Yak Posting Veteran

77 Posts

Posted - 2001-10-19 : 18:24:22
Hello there,

I have another query performance question. I have an extremely slow performing query that uses a subquery.

Here are the parties involved.

TABLE 1.
about 300K + rows
CurrentDelinquency
(
ACCT_NUM varchar(12)
)
Table 2.
250K + Rows
AccountsUncallable
(
ACCT_NUM varchar(12)
)

SELECT COUNT(DISTINCT ACCT_NUM)
FROM CurrentDelinquency
WHERE ACCT_NUM NOT IN
(SELECT DISTINCT ACCT_NUM FROM AccountsUncallable)

It takes forever to run.

thanks for any replies!

Creighton

   

- Advertisement -