July 1, 2005 at 5:50 pm
Can some one optimize this query
UPDATE T1
SET T1.COL1 = '1'
WHERE T1.ID NOT IN (SELECT ID FROM T2 WHERE T2.COL1='XX' AND T2.COL2='XXX')
AND T1.COL2='XX'
With 400 records in T1 and 5000 records in T2 with some duplicates
its taking more than 20 min .
Thanks
ash
July 1, 2005 at 6:36 pm
Is this running on a 386???
Is there a trigger in the table. Are there any indexes on those tables?
July 1, 2005 at 8:53 pm
I think I have one of the last 386s still running. I keep it so when I get frustrated with slow I can be reminded of what SLOW really is. Turn it on go get a cup of coffee and wow you are almost up and running.
Mike
July 1, 2005 at 10:12 pm
Depends how long you drive to get your coffee. If it's less than 10 blocks, it might still be booting when you get back .
July 2, 2005 at 1:10 am
Sorry T2 is not table its view and running on sql srv 2000
July 2, 2005 at 5:51 am
Show us the definition for T2.
Aunt Kathi Data Platform MVP
Author of Expert T-SQL Window Functions
Simple-Talk Editor
Viewing 6 posts - 1 through 5 (of 5 total)
You must be logged in to reply to this topic. Login to reply