slow update (primary key)

  • dear Friends

    when i run below query its take

    more than 10 minutes and still running....

    update auditdata set TATCallType='12',TATCallUnit='1' from auditdata auditdata inner join Auditdata_sms_12 a_sns on auditdata.ID = a_sns.id

    auditdata is my original table

    in above table ID is primary key

    Auditdata_sms_12 is my temp table

    whats wrong in aobe SQL Query

    plz help me

    thanx in advance..

  • You might have a missing index issue (probably missing for your temp table).

    We can't tell for sure since there is no more information available from your site.

    Please read and follow the guideline described in the following article:

    http://www.sqlservercentral.com/articles/SQLServerCentral/66909/



    Lutz
    A pessimist is an optimist with experience.

    How to get fast answers to your question[/url]
    How to post performance related questions[/url]
    Links for Tally Table [/url] , Cross Tabs [/url] and Dynamic Cross Tabs [/url], Delimited Split Function[/url]

  • It could be bad or missing indexes. It could be that your process is blocked by others. It could be simply resource contention.

    Hard to know with out quite a bit more information.

    "The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
    - Theodore Roosevelt

    Author of:
    SQL Server Execution Plans
    SQL Server Query Performance Tuning

  • If you're having this many performance problems with a procedure, I would suggest you consider getting a specialist in to help you, especially if you're not good at tuning. They can fix your performance problems far faster than we can and they can teach you in the process.

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply