Blocking

  • I have 2 different tables i.e. TABLE A and TABLE B . Activity on these tables is updating column values.However, due to this Locking is noticed and cause time outs? Any ideas?

    Thanks

  • Can you provide further information? What is being blocked?

    ______________________________________________________________________________Never argue with an idiot; Theyll drag you down to their level and beat you with experience

  • Locking is a natural DB phenomenon. You should be worried more about blocking. Provide more details ..

    --

    SQLBuddy

  • Lets consider 2 different tables TABLE A and TABLE B.Now, suppose that there are two different sessions with different activity. Does one of the session will be blocked or timed out?

    Let me know if you still have questions?

  • if both differnt sessions/ activities are going to update both tables TableA and TableB, then ofcourse locking will heppan. based on number of rows, DB isolation level, processing time of each session may end up blocking, as well.

    Avi.

  • Admingod (3/27/2014)


    Lets consider 2 different tables TABLE A and TABLE B.Now, suppose that there are two different sessions with different activity. Does one of the session will be blocked or timed out?

    Let me know if you still have questions?

    If the code is written correctly and the table/indexes are designed correctly, the blocking will be so short that it doesn't matter and you won't get a time out.

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

  • Admingod (3/27/2014)


    Lets consider 2 different tables TABLE A and TABLE B.Now, suppose that there are two different sessions with different activity. Does one of the session will be blocked or timed out?

    Let me know if you still have questions?

    Is this a general question or an issue that you are having ?

    --

    SQLBuddy

  • The key is to make your queries run as fast as possible and keep the transactions as short as possible. So, if you're running an UPDATE statement, make sure it's using a WHERE clause and that there is an index for the WHERE clause to find the data really fast. But, if you don't have one, it will take longer and longer to access the table.

    "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

Viewing 8 posts - 1 through 7 (of 7 total)

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