Update query

  • 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

     

     

     

     

  • Is this running on a 386???

    Is there a trigger in the table. Are there any indexes on those tables?

  • 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

  • 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 .

  • Sorry T2 is not table its view and running on sql srv 2000

  • 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