Why is SQL Server 2008 blocking SELECT's on long transaction INSERT's?

后端 未结 4 1466
花落未央
花落未央 2021-02-02 14:26

We are trying to have a transactional table that only takes new records inserted on a regular basis.

This simple table requires us to continuously add new records to it

4条回答
  •  日久生厌
    2021-02-02 14:47

    This exists in MySQL too. Here's the logic behind it: if you perform a SELECT on some data, you expect it to operate on an up-to-date dataset. That's why INSERT results in a table-level lock (that is unless the engine is able to perform row-level locking, like innodb can). There are ways to disable this behaviour, so that you can do "dirty reads", but they all are software (or even database-engine) specific.

提交回复
热议问题