What makes you think that this should be a table-level lock, if there is an identity. I don't see this in any documentation, and I just checked the insert with (rowlock) in the table with the identity column, and it works.
To minimize locking, lock the rows. For all stored procedures, update the tables in the same order.
Do you have inserts in three tables, each up to ten seconds? I have some inserts in transactions that fall into several tables (some of them are large) and get 100 / second.
Browse the table design and its keys. If you can choose a cluster PC that represents the order of your insertion, and if you can sort before insertion, that will make a huge difference. Review the need for any other indexes. If you must have other indexes, then track fragmentation and defragmentation.
Connected, but not the same. I have a dataloader that needs to parse some data and then load millions of rows at night, but not in a transaction. It was optimized for 4 parallel processes, starting with empty tables, but the problem was that after two hours the download throughput decreased by 10 times due to fragmentation. I reworked the tables, so the PK clustering index was included in the insertion order. Discarded any other index that did not give at least a 50% choice. On a nightly insert, first remove (disable) the indexes and use only two streams. One thread to parse and one to insert. Then I recreate the index at the end of the download. Got a 100: 1 improvement over 4 threads, scoring indices. Yes, you have another problem, but check your tables. Too often, I think that indexes are added for small selection privileges without taking into account the hit for insertion and update. In addition, the choice of benefits is often evaluated as the index is created and compared, and the fresh index has no fragmentation.
paparazzo
source share