question about inserts

  • Hello, will having multiple inserts hitting a single table at once cause an issue? I think sql will lock the table during each insert statment...but as long as the inserts are small...it shouldnt be a problem? correct? once one insert completes....the other will start?

    Thanks.

  • blondie (9/1/2010)


    Hello, will having multiple inserts hitting a single table at once cause an issue? I think sql will lock the table during each insert statment...but as long as the inserts are small...it shouldnt be a problem? correct? once one insert completes....the other will start?

    That's a very good question indeed Blondie.

    As it always happens in the database world the answer starts with "it depends" 😀

    In this particular case it depends on the definition of "multiple inserts". If by multiple inserts you mean a reasonable number of users taking advantage of the same application I would say you will be Okay but, if by "multiple inserts" you actually mean thousands of transactions per second hitting the target table then a more carefull approach is needed.

    Have you simulated the work load?

    _____________________________________
    Pablo (Paul) Berzukov

    Author of Understanding Database Administration available at Amazon and other bookstores.

    Disclaimer: Advice is provided to the best of my knowledge but no implicit or explicit warranties are provided. Since the advisor explicitly encourages testing any and all suggestions on a test non-production environment advisor should not held liable or responsible for any actions taken based on the given advice.
  • I like PaulB's answer. It does depend. In previous versions last page contention was much more of a problem, and by and large you will not see full table locks, you might see some processes being forced to wait.

    However, if you are doing a large number of inserts at a time, meaning a bunch of records at once then you might really want to rethink the process.

    Why don't you describe your process in a little detail so we can get a better idea of how to help you.

    CEWII

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

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