PAGELATCH_EX waits and heavy inserts

Published Mar 23 2019 01:19 PM 3,352 Views
Microsoft

First published on MSDN on May 23, 2013
Hello all,

Recently I came across an issue over a table that was being inserted into quite intensively, by concurrent operations. The issue, which is not that uncommon, is dealing with PAGELATCH EX contention, namely when a table has a clustering key that conforms with the concept of a small and monotonically increasing value, such as IDENTITY, and the table itself is somewhat narrow.

First, what is a PAGELATCH? In a nutshell, a PAGELATCH is used to synchronize short term access to database pages that reside in the Buffer cache, as opposed to a PAGEIOLATCH, which is used to synchronize physical access to pages in disk. These are normal in every system, the problem being when there is contention. In this case when there are many concurrent accesses to a single page, causing waits and hindering the ability to perform these inserts efficiently.

So let’s create a table to repro the issue:


IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'dbo.HeavyInsert') AND type in (N'U'))
DROP TABLE dbo.HeavyInsert
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'dbo.HeavyInsert') AND type in (N'U'))
CREATE TABLE dbo.HeavyInsert(
ID int IDENTITY(1,1) NOT NULL
, col1 VARCHAR(50) NOT NULL)
GO

CREATE UNIQUE CLUSTERED INDEX CIX
ON dbo.HeavyInsert (ID)
GO


As you can see there is only one column that is a usual candidate for the clustering key (ID) and a single column where data is inserted, making this a narrow table. Now what happens when 120 concurrent connections insert 100,000 rows each? For that purpose we will use the code below:


SET NOCOUNT ON;
DECLARE @i int = 1
WHILE @i < 100000
BEGIN
INSERT INTO dbo.HeavyInsert (col1) VALUES ('testing heavy')
SET @i += 1
END;


Using one of our SQL Swiss Army Knife scripts to check for locking and blocking, we immediately see that of the 120 concurrent sessions running the same INSERTs (1st half of the image below), 119 are being blocked (2nd half of the image below), and most of these with wait type PAGELATCH_EX:



The wait resource in this case is 9:1:197381, meaning database id 9, file 1 and page 197381. We can take a look inside that page to determine what it is by using the DBCC PAGE command:


DBCC TRACEON(3604)
GO
DBCC PAGE(9,1,197381,0)
GO


Which gives us the page header, were we can see that it is a data page (type 1) belonging to index id 1, on object id 1967280201:



The object id can be matched to an actual object name using the OBJECT_NAME function, which gives us the HeavyInsert table we created:


SELECT OBJECT_NAME(1967280201,9)
GO


On my quad-core hyper-threaded laptop with 16GB of RAM and SSDs, these 11,999,880 inserts took a little over 5 minutes (05:20.623).

So how to minimize this kind of bottleneck?

There is a really good whitepaper that about this contention scenario, with several approaches to dealing with this type of contention that work really well. But I also found another solution that works really well, namely one that can be implemented specifically in SQL Server 2012, and does not use an Enterprise-only feature. But more on that ahead…

These are the alternatives the whitepaper provides:

    1. Using a GUID as the leading key column of an index. I’m not very fond of that strategy as it presents other challenges in itself, namely for reads in my OLTP system, so I won’t test that one.
    2. Another alternative is using a non-sequential value as the leading index key (a hash), which will also spread out the inserts. The caveat is that being the lead column, this can also result in less than efficient clustered indexes, namely when the clustering key is also the primary key (and it is also a natural key). But it is something to consider if you are running on a Standard Edition of SQL Server, that cannot support the next option.
    3. A third alternative implies using hash partitioning with a computed column, which uses table partitioning, and is therefore only usable in Enterprise Editions of SQL Server. Let’s explore this one.

First we create a table with an extra computed column , which is marked as persisted.


IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'dbo.HeavyInsert_Hash') AND type in (N'U'))
DROP TABLE dbo.HeavyInsert_Hash
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'dbo.HeavyInsert_Hash') AND type in (N'U'))
CREATE TABLE dbo.HeavyInsert_Hash(
ID INT IDENTITY(1,1) NOT NULL
, col1 VARCHAR(50) NOT NULL
, HashID AS CONVERT(tinyint, ABS(ID % 8)) PERSISTED NOT NULL)
GO


Now we will create the partitioning function and schema, on where we will create the clustered index:


CREATE PARTITION FUNCTION pf_hash (tinyint) AS RANGE LEFT FOR VALUES (0,1,2,3,4,5,6,7)
GO
CREATE PARTITION SCHEME ps_hash AS PARTITION pf_hash ALL TO ([PRIMARY])
GO

CREATE UNIQUE CLUSTERED INDEX CIX_Hash
ON dbo.HeavyInsert_Hash (ID, HashID) ON ps_hash(HashID)
GO


As you can see, the hash will be the partitioning key, and that will conceptually allow the inserts to be distributed over several partitions in a pseudo-round robin fashion (not exactly, but close enough for the purpose of this discussion). Let’s determine if that is the behavior using the code below, again with the same 120 concurrent connections:


DECLARE @i int = 1
WHILE @i < 100000
BEGIN
INSERT INTO dbo.HeavyInsert_Hash (col1) VALUES ('testing heavy')
SET @i += 1
END;
GO


Checking for contention, we see on the top the same 120 concurrent sessions, and in the bottom we have some 65 blocked spids, but now the prevalent wait is WRITELOG, and much less PAGELATCH_EX contention. For the one seen below, using the same DBCC PAGE we can see it is again a data page, this time in the HeavyInsert_Hash table.



We also see WRITELOG waits are occurring, and when this happens we should check what are the latencies we are getting from the volume that holds the relevant transaction logs.
Remember that while I’m running this test on an SSD, it is a laptop, not an enterprise-class storage. Still, for the elapsed time of this test, the counter Avg. Disk sec/Write for the transaction log drive (yes, it’s on C) averaged to just 2ms, although it spiked at 17ms:



This insert cycle took a little over 2 minutes (02:13.055) and we have effectively minimized the PAGELATCH_EX contention in our table, while being able to insert much faster. With the same 11,999,880 inserted records, we can see how these were spread out by partitioning our table, although still writing to the same file and filegroup:



Much better, but I mentioned a different solution that did not require using an Enterprise-only feature, while still taking care of this contention.

The alternative is using bit reversal using the SEQUENCE feature introduced in SQL Server 2012, credits to DangerousDBA ( blog ) for the original idea.

For this, we will create a sequence to generate the incremental values we need as our clustering key:


IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'dbo.seqAdvWorks') AND type in (N'SO'))
DROP SEQUENCE dbo.seqAdvWorks
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'dbo.seqAdvWorks') AND type in (N'SO'))
CREATE SEQUENCE dbo.seqAdvWorks AS int
START WITH 1
INCREMENT BY 1
GO


And the bit reversal function that will generate an integer value:


IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[ufn_BitReverse]') AND type in (N'FN', N'IF', N'TF', N'FS', N'FT'))
DROP FUNCTION [dbo].[ufn_BitReverse]
GO
CREATE FUNCTION ufn_BitReverse (@InputVal int)
RETURNS int
WITH SCHEMABINDING
AS
BEGIN
DECLARE @WorkValue int = @InputVal
DECLARE @Result int = 0;
DECLARE @Counter tinyint = 0;
WHILE @Counter < 31 -- 63 for bigint
BEGIN
SET @Result = @Result*2
IF (@WorkValue&1) = 1
BEGIN
SET @Result = @Result+1
SET @WorkValue = @WorkValue-1
END
SET @WorkValue = @WorkValue/2
SET @Counter = @Counter+1
END
RETURN @Result
END;
GO


And a new table for this test, which is the very same as our initial table:


IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'dbo.HeavyInsert_BitReversal') AND type in (N'U'))
DROP TABLE dbo.HeavyInsert_BitReversal
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'dbo.HeavyInsert_BitReversal') AND type in (N'U'))
CREATE TABLE dbo.HeavyInsert_BitReversal(
ID int NOT NULL
, col1 VARCHAR(50) NOT NULL)
GO

CREATE UNIQUE CLUSTERED INDEX CIX_BitReversal
ON dbo.HeavyInsert_BitReversal (ID)
GO


The integer value generated by the function will be used during the inserts, and conceptually it is random enough to spread out the inserts by different pages. So we have to get the next value for the sequence, and use it in the insert statement:


DECLARE @value int
DECLARE @i int = 1
WHILE @i < 100000
BEGIN
SELECT @value = NEXT VALUE FOR dbo.seqAdvWorks
INSERT INTO dbo.HeavyInsert_BitReversal (ID,col1)
SELECT dbo.ufn_BitReverse(@value),'testing heavy'
SET @i += 1
END;
GO


Once the workload is running on the 120 sessions, while checking for contention we can see that PAGELATCH_EX contention is occurring on resource 9:1:24273:



What we can also determine, for example looking at spid 163, is that the running statement during the latch contention is the NEXT VALUE FOR sequence. Using DBCC PAGE, we can see that the object id is 60, which is the sysobjvalues system table. This table is used to hold metadata while accessing the sequence to get the current value.



So it seems that we are not incurring in PAGELATCH_EX waits in the data insertion itself, but while getting the next value for the sequence. That can be resolved using the sequence cache for a large value, like below:


IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'dbo.seqAdvWorks') AND type in (N'SO'))
DROP SEQUENCE dbo.seqAdvWorks
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'dbo.seqAdvWorks') AND type in (N'SO'))
CREATE SEQUENCE dbo.seqAdvWorks AS int
START WITH 1
INCREMENT BY 1
START WITH 1
CACHE 10000
GO


We have set the value at 10,000 (mileage may vary) and this way we will have less frequent access to the sysobjvalues system table.

Running the same insert workload we have no visible contention as before. For the same 11,999,880 inserted records, the cycle took a little over 4 minutes (04:00.961), so I find this to be an elegant solution for addressing PAGELATCH_EX contention in this scenario.

As a summary, if we analyze the Wait Statistics: Page Latch waits performance counter for the duration of the tests, we find that while the hash partitioning scenario provides better performance, the bit reversal gets the lowest PAGELATCH waits.

 

Min


Avg


Max


Time (mi:ss.ms)


HeavyInsert


0


226,726


339,493


05:20.623


HeavyInsert_Hash


0


14,424


52,879


02:13.055


HeavyInsert_BitReversal


0


2,124


13,003


04:00.961


Hope you find it useful!

Pedro Lopes ( @SQLPedro

%3CLINGO-SUB%20id%3D%22lingo-sub-384289%22%20slang%3D%22en-US%22%3EPAGELATCH_EX%20waits%20and%20heavy%20inserts%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-384289%22%20slang%3D%22en-US%22%3E%3CP%3E%3CSTRONG%3EFirst%20published%20on%20MSDN%20on%20May%2023%2C%202013%20%3C%2FSTRONG%3E%3CBR%20%2F%3EHello%20all%2C%20%3CBR%20%2F%3E%3CBR%20%2F%3ERecently%20I%20came%20across%20an%20issue%20over%20a%20table%20that%20was%20being%20inserted%20into%20quite%20intensively%2C%20by%20concurrent%20operations.%20The%20issue%2C%20which%20is%20not%20that%20uncommon%2C%20is%20dealing%20with%20%3CA%20href%3D%22http%3A%2F%2Fmsdn.microsoft.com%2Fen-us%2Flibrary%2Fms179984.aspx%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3EPAGELATCH%20EX%3C%2FA%3Econtention%2C%20namely%20when%20a%20table%20has%20a%20clustering%20key%20that%20conforms%20with%20the%20concept%20of%20a%20small%20and%20monotonically%20increasing%20value%2C%20such%20as%20%3CA%20href%3D%22http%3A%2F%2Fmsdn.microsoft.com%2Fen-us%2Flibrary%2Fms186775.aspx%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3EIDENTITY%3C%2FA%3E%2C%20and%20the%20table%20itself%20is%20somewhat%20narrow.%20%3CBR%20%2F%3E%3CBR%20%2F%3EFirst%2C%20what%20is%20a%20PAGELATCH%3F%20In%20a%20nutshell%2C%20a%20PAGELATCH%20is%20used%20to%20synchronize%20short%20term%20access%20to%20database%20pages%20that%20reside%20in%20the%20Buffer%20cache%2C%20as%20opposed%20to%20a%20PAGEIOLATCH%2C%20which%20is%20used%20to%20synchronize%20physical%20access%20to%20pages%20in%20disk.%20These%20are%20normal%20in%20every%20system%2C%20the%20problem%20being%20when%20there%20is%20contention.%20In%20this%20case%20when%20there%20are%20many%20concurrent%20accesses%20to%20a%20single%20page%2C%20causing%20waits%20and%20hindering%20the%20ability%20to%20perform%20these%20inserts%20efficiently.%20%3CBR%20%2F%3E%3CBR%20%2F%3ESo%20let%E2%80%99s%20create%20a%20table%20to%20repro%20the%20issue%3A%3C%2FP%3E%0A%3CP%3E%3CBR%20%2F%3EIF%20EXISTS%20(SELECT%20*%20FROM%20sys.objects%20WHERE%20object_id%20%3D%20OBJECT_ID(N'dbo.HeavyInsert')%20AND%20type%20in%20(N'U'))%20%3CBR%20%2F%3EDROP%20TABLE%20dbo.HeavyInsert%20%3CBR%20%2F%3EIF%20NOT%20EXISTS%20(SELECT%20*%20FROM%20sys.objects%20WHERE%20object_id%20%3D%20OBJECT_ID(N'dbo.HeavyInsert')%20AND%20type%20in%20(N'U'))%20%3CBR%20%2F%3ECREATE%20TABLE%20dbo.HeavyInsert(%20%3CBR%20%2F%3EID%20int%20IDENTITY(1%2C1)%20NOT%20NULL%20%3CBR%20%2F%3E%2C%20col1%20VARCHAR(50)%20NOT%20NULL)%20%3CBR%20%2F%3EGO%20%3CBR%20%2F%3E%3CBR%20%2F%3ECREATE%20UNIQUE%20CLUSTERED%20INDEX%20CIX%20%3CBR%20%2F%3EON%20dbo.HeavyInsert%20(ID)%20%3CBR%20%2F%3EGO%3C%2FP%3E%0A%3CP%3E%3CBR%20%2F%3EAs%20you%20can%20see%20there%20is%20only%20one%20column%20that%20is%20a%20usual%20candidate%20for%20the%20clustering%20key%20(ID)%20and%20a%20single%20column%20where%20data%20is%20inserted%2C%20making%20this%20a%20narrow%20table.%20Now%20what%20happens%20when%20120%20concurrent%20connections%20insert%20100%2C000%20rows%20each%3F%20For%20that%20purpose%20we%20will%20use%20the%20code%20below%3A%3C%2FP%3E%0A%3CP%3E%3CBR%20%2F%3ESET%20NOCOUNT%20ON%3B%20%3CBR%20%2F%3EDECLARE%20%40i%20int%20%3D%201%20%3CBR%20%2F%3EWHILE%20%40i%20%26lt%3B%20100000%20%3CBR%20%2F%3EBEGIN%20%3CBR%20%2F%3EINSERT%20INTO%20dbo.HeavyInsert%20(col1)%20VALUES%20('testing%20heavy')%20%3CBR%20%2F%3ESET%20%40i%20%2B%3D%201%20%3CBR%20%2F%3EEND%3B%3C%2FP%3E%0A%3CP%3E%3CBR%20%2F%3EUsing%20one%20of%20our%20%3CA%20href%3D%22http%3A%2F%2Fblogs.msdn.com%2Fb%2Fblogdoezequiel%2Farchive%2F2012%2F09%2F18%2Fsql-swiss-army-knife-11-1-locking-blocking-and-active-transactions.aspx%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3ESQL%20Swiss%20Army%20Knife%20%3C%2FA%3Escripts%20to%20check%20for%20locking%20and%20blocking%2C%20we%20immediately%20see%20that%20of%20the%20120%20concurrent%20sessions%20running%20the%20same%20INSERTs%20(1st%20half%20of%20the%20image%20below)%2C%20119%20are%20being%20blocked%20(2nd%20half%20of%20the%20image%20below)%2C%20and%20most%20of%20these%20with%20wait%20type%20PAGELATCH_EX%3A%20%3CBR%20%2F%3E%3CBR%20%2F%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20757px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F97740iCE3750E112B111BD%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20%2F%3E%3C%2FSPAN%3E%3CBR%20%2F%3E%3CBR%20%2F%3EThe%20wait%20resource%20in%20this%20case%20is%209%3A1%3A197381%2C%20meaning%20database%20id%209%2C%20file%201%20and%20page%20197381.%20We%20can%20take%20a%20look%20inside%20that%20page%20to%20determine%20what%20it%20is%20by%20using%20the%20%3CA%20href%3D%22http%3A%2F%2Fblogs.msdn.com%2Fb%2Fsqlserverstorageengine%2Farchive%2F2006%2F06%2F10%2F625659.aspx%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3EDBCC%20PAGE%20%3C%2FA%3Ecommand%3A%3C%2FP%3E%0A%3CP%3E%3CBR%20%2F%3EDBCC%20TRACEON(3604)%20%3CBR%20%2F%3EGO%20%3CBR%20%2F%3EDBCC%20PAGE(9%2C1%2C197381%2C0)%20%3CBR%20%2F%3EGO%3C%2FP%3E%0A%3CP%3E%3CBR%20%2F%3EWhich%20gives%20us%20the%20page%20header%2C%20were%20we%20can%20see%20that%20it%20is%20a%20data%20page%20(type%201)%20belonging%20to%20index%20id%201%2C%20on%20object%20id%201967280201%3A%20%3CBR%20%2F%3E%3CBR%20%2F%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20766px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F97741i3EDE6E22EE8105BA%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20%2F%3E%3C%2FSPAN%3E%3CBR%20%2F%3E%3CBR%20%2F%3EThe%20object%20id%20can%20be%20matched%20to%20an%20actual%20object%20name%20using%20the%20%3CA%20href%3D%22http%3A%2F%2Fmsdn.microsoft.com%2Fen-US%2Flibrary%2Fms186301.aspx%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3EOBJECT_NAME%20%3C%2FA%3Efunction%2C%20which%20gives%20us%20the%20%3CEM%3EHeavyInsert%20%3C%2FEM%3Etable%20we%20created%3A%3C%2FP%3E%0A%3CP%3E%3CBR%20%2F%3ESELECT%20OBJECT_NAME(1967280201%2C9)%20%3CBR%20%2F%3EGO%3C%2FP%3E%0A%3CP%3E%3CBR%20%2F%3EOn%20my%20quad-core%20hyper-threaded%20laptop%20with%2016GB%20of%20RAM%20and%20SSDs%2C%20these%2011%2C999%2C880%20inserts%20took%20a%20little%20over%205%20minutes%20(05%3A20.623).%20%3CBR%20%2F%3E%3CBR%20%2F%3ESo%20how%20to%20minimize%20this%20kind%20of%20bottleneck%3F%20%3CBR%20%2F%3E%3CBR%20%2F%3EThere%20is%20a%20really%20good%20%3CA%20href%3D%22http%3A%2F%2Fwww.microsoft.com%2Fen-us%2Fdownload%2Fdetails.aspx%3Fid%3D26665%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3Ewhitepaper%20%3C%2FA%3Ethat%20about%20this%20contention%20scenario%2C%20with%20several%20approaches%20to%20dealing%20with%20this%20type%20of%20contention%20that%20work%20really%20well.%20But%20I%20also%20found%20another%20solution%20that%20works%20really%20well%2C%20namely%20one%20that%20can%20be%20implemented%20specifically%20in%20SQL%20Server%202012%2C%20and%20does%20not%20use%20an%20Enterprise-only%20feature.%20But%20more%20on%20that%20ahead%E2%80%A6%20%3CBR%20%2F%3E%3CBR%20%2F%3EThese%20are%20the%20alternatives%20the%20%3CA%20href%3D%22http%3A%2F%2Fwww.microsoft.com%2Fen-us%2Fdownload%2Fdetails.aspx%3Fid%3D26665%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3Ewhitepaper%20%3C%2FA%3Eprovides%3A%20%3CBR%20%2F%3E%3CBR%20%2F%3E%3C%2FP%3E%0A%3COL%3E%0A%3COL%3E%0A%3CLI%3EUsing%20a%20GUID%20as%20the%20leading%20key%20column%20of%20an%20index.%20I%E2%80%99m%20not%20very%20fond%20of%20that%20strategy%20as%20it%20presents%20other%20challenges%20in%20itself%2C%20namely%20for%20reads%20in%20my%20OLTP%20system%2C%20so%20I%20won%E2%80%99t%20test%20that%20one.%3C%2FLI%3E%0A%3CLI%3EAnother%20alternative%20is%20using%20a%20non-sequential%20value%20as%20the%26nbsp%3Bleading%20index%20key%20(a%20hash)%2C%20which%20will%20also%20spread%20out%20the%20inserts.%20The%20caveat%20is%20that%20being%20the%20lead%20column%2C%20this%20can%20also%20result%20in%20less%20than%20efficient%20clustered%20indexes%2C%20namely%20when%20the%20clustering%20key%20is%20also%20the%20primary%20key%20(and%20it%20is%20also%20a%20natural%20key).%20But%20it%20is%20something%20to%20consider%20if%20you%20are%20running%20on%20a%20Standard%20Edition%20of%20SQL%20Server%2C%20that%20cannot%20support%20the%20next%20option.%3C%2FLI%3E%0A%3CLI%3EA%20third%20alternative%20implies%20using%20hash%20partitioning%20with%20a%20computed%20column%2C%20which%20uses%20table%20partitioning%2C%20and%20is%20therefore%20only%20usable%20in%20Enterprise%20Editions%20of%20SQL%20Server.%20Let%E2%80%99s%20explore%20this%20one.%3C%2FLI%3E%0A%3C%2FOL%3E%0A%3C%2FOL%3E%0A%3CP%3EFirst%20we%20create%20a%20table%20with%20an%20extra%20%3CA%20href%3D%22http%3A%2F%2Fmsdn.microsoft.com%2Fen-us%2Flibrary%2Fms186241.aspx%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3Ecomputed%20column%20%3C%2FA%3E%2C%20which%20is%20marked%20as%20persisted.%3C%2FP%3E%0A%3CP%3E%3CBR%20%2F%3EIF%20EXISTS%20(SELECT%20*%20FROM%20sys.objects%20WHERE%20object_id%20%3D%20OBJECT_ID(N'dbo.HeavyInsert_Hash')%20AND%20type%20in%20(N'U'))%20%3CBR%20%2F%3EDROP%20TABLE%20dbo.HeavyInsert_Hash%20%3CBR%20%2F%3EIF%20NOT%20EXISTS%20(SELECT%20*%20FROM%20sys.objects%20WHERE%20object_id%20%3D%20OBJECT_ID(N'dbo.HeavyInsert_Hash')%20AND%20type%20in%20(N'U'))%20%3CBR%20%2F%3ECREATE%20TABLE%20dbo.HeavyInsert_Hash(%20%3CBR%20%2F%3EID%20INT%20IDENTITY(1%2C1)%20NOT%20NULL%20%3CBR%20%2F%3E%2C%20col1%20VARCHAR(50)%20NOT%20NULL%20%3CBR%20%2F%3E%2C%20HashID%20AS%20CONVERT(tinyint%2C%20ABS(ID%20%25%208))%20PERSISTED%20NOT%20NULL)%20%3CBR%20%2F%3EGO%3C%2FP%3E%0A%3CP%3E%3CBR%20%2F%3ENow%20we%20will%20create%20the%20partitioning%20function%20and%20schema%2C%20on%20where%20we%20will%20create%20the%20clustered%20index%3A%3C%2FP%3E%0A%3CP%3E%3CBR%20%2F%3ECREATE%20PARTITION%20FUNCTION%20pf_hash%20(tinyint)%20AS%20RANGE%20LEFT%20FOR%20VALUES%20(0%2C1%2C2%2C3%2C4%2C5%2C6%2C7)%20%3CBR%20%2F%3EGO%20%3CBR%20%2F%3ECREATE%20PARTITION%20SCHEME%20ps_hash%20AS%20PARTITION%20pf_hash%20ALL%20TO%20(%5BPRIMARY%5D)%20%3CBR%20%2F%3EGO%20%3CBR%20%2F%3E%3CBR%20%2F%3ECREATE%20UNIQUE%20CLUSTERED%20INDEX%20CIX_Hash%20%3CBR%20%2F%3EON%20dbo.HeavyInsert_Hash%20(ID%2C%20HashID)%20ON%20ps_hash(HashID)%20%3CBR%20%2F%3EGO%3C%2FP%3E%0A%3CP%3E%3CBR%20%2F%3EAs%20you%20can%20see%2C%20the%20hash%20will%20be%20the%20partitioning%20key%2C%20and%20that%20will%20conceptually%20allow%20the%20inserts%20to%20be%20distributed%20over%20several%20partitions%20in%20a%20pseudo-round%20robin%20fashion%20(not%20exactly%2C%20but%20close%20enough%20for%20the%20purpose%20of%20this%20discussion).%20Let%E2%80%99s%20determine%20if%20that%20is%20the%20behavior%20using%20the%20code%20below%2C%20again%20with%20the%20same%20120%20concurrent%20connections%3A%3C%2FP%3E%0A%3CP%3E%3CBR%20%2F%3EDECLARE%20%40i%20int%20%3D%201%20%3CBR%20%2F%3EWHILE%20%40i%20%26lt%3B%20100000%20%3CBR%20%2F%3EBEGIN%20%3CBR%20%2F%3EINSERT%20INTO%20dbo.HeavyInsert_Hash%20(col1)%20VALUES%20('testing%20heavy')%20%3CBR%20%2F%3ESET%20%40i%20%2B%3D%201%20%3CBR%20%2F%3EEND%3B%20%3CBR%20%2F%3EGO%3C%2FP%3E%0A%3CP%3E%3CBR%20%2F%3EChecking%20for%20contention%2C%20we%20see%20on%20the%20top%20the%20same%20120%20concurrent%20sessions%2C%20and%20in%20the%20bottom%20we%20have%20some%2065%20blocked%20spids%2C%20but%20now%20the%20prevalent%20wait%20is%20WRITELOG%2C%20and%20much%20less%20PAGELATCH_EX%20contention.%20For%20the%20one%20seen%20below%2C%20using%20the%20same%20DBCC%20PAGE%20we%20can%20see%20it%20is%20again%20a%20data%20page%2C%20this%20time%20in%20the%20%3CEM%3EHeavyInsert_Hash%20%3C%2FEM%3Etable.%20%3CBR%20%2F%3E%3CBR%20%2F%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20767px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F97742i7E94F84DA229F870%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20%2F%3E%3C%2FSPAN%3E%20%3CBR%20%2F%3E%3CBR%20%2F%3EWe%20also%20see%20WRITELOG%20waits%20are%20occurring%2C%20and%20when%20this%20happens%20we%20should%20check%20what%20are%20the%20latencies%20we%20are%20getting%20from%20the%20volume%20that%20holds%20the%20relevant%20transaction%20logs.%20%3CBR%20%2F%3ERemember%20that%20while%20I%E2%80%99m%20running%20this%20test%20on%20an%20SSD%2C%20it%20is%20a%20laptop%2C%20not%20an%20enterprise-class%20storage.%20Still%2C%20for%20the%20elapsed%20time%20of%20this%20test%2C%20the%20counter%20%3CA%20href%3D%22http%3A%2F%2Fblogs.technet.com%2Fb%2Fcotw%2Farchive%2F2009%2F03%2F18%2Fanalyzing-storage-performance.aspx%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noreferrer%22%3EAvg.%20Disk%20sec%2FWrite%20%3C%2FA%3Efor%20the%20transaction%20log%20drive%20(yes%2C%20it%E2%80%99s%20on%20C)%20averaged%20to%20just%202ms%2C%20although%20it%20spiked%20at%2017ms%3A%20%3CBR%20%2F%3E%3CBR%20%2F%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20772px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F97743i59F94C9AC34B9411%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20%2F%3E%3C%2FSPAN%3E%3CBR%20%2F%3E%3CBR%20%2F%3EThis%20insert%20cycle%20took%20a%20little%20over%202%20minutes%20(02%3A13.055)%20and%20we%20have%20effectively%20minimized%20the%20PAGELATCH_EX%20contention%20in%20our%20table%2C%20while%20being%20able%20to%20insert%20much%20faster.%20With%20the%20same%2011%2C999%2C880%20inserted%20records%2C%20we%20can%20see%20how%20these%20were%20spread%20out%20by%20partitioning%20our%20table%2C%20although%20still%20writing%20to%20the%20same%20file%20and%20filegroup%3A%20%3CBR%20%2F%3E%3CBR%20%2F%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20446px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F97744i74580726B6EFD22E%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20%2F%3E%3C%2FSPAN%3E%3CBR%20%2F%3E%3CBR%20%2F%3EMuch%20better%2C%20but%20I%20mentioned%20a%20different%20solution%20that%20did%20not%20require%20using%20an%20Enterprise-only%20feature%2C%20while%20still%20taking%20care%20of%20this%20contention.%20%3CBR%20%2F%3E%3CBR%20%2F%3EThe%20alternative%20is%20using%20bit%20reversal%20using%20the%20%3CA%20href%3D%22http%3A%2F%2Fmsdn.microsoft.com%2Fen-us%2Flibrary%2Fff878091.aspx%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3ESEQUENCE%20%3C%2FA%3Efeature%20introduced%20in%20SQL%20Server%202012%2C%20credits%20to%20DangerousDBA%20(%20%3CA%20href%3D%22http%3A%2F%2Fdangerousdba.blogspot.co.uk%2F2011%2F10%2Fbit-reversion.html%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noreferrer%22%3Eblog%20%3C%2FA%3E)%20for%20the%20original%20idea.%20%3CBR%20%2F%3E%3CBR%20%2F%3EFor%20this%2C%20we%20will%20create%20a%20sequence%20to%20generate%20the%20incremental%20values%20we%20need%20as%20our%20clustering%20key%3A%3C%2FP%3E%0A%3CP%3E%3CBR%20%2F%3EIF%20EXISTS%20(SELECT%20*%20FROM%20sys.objects%20WHERE%20object_id%20%3D%20OBJECT_ID(N'dbo.seqAdvWorks')%20AND%20type%20in%20(N'SO'))%20%3CBR%20%2F%3EDROP%20SEQUENCE%20dbo.seqAdvWorks%20%3CBR%20%2F%3EIF%20NOT%20EXISTS%20(SELECT%20*%20FROM%20sys.objects%20WHERE%20object_id%20%3D%20OBJECT_ID(N'dbo.seqAdvWorks')%20AND%20type%20in%20(N'SO'))%20%3CBR%20%2F%3ECREATE%20SEQUENCE%20dbo.seqAdvWorks%20AS%20int%20%3CBR%20%2F%3ESTART%20WITH%201%20%3CBR%20%2F%3EINCREMENT%20BY%201%20%3CBR%20%2F%3EGO%3C%2FP%3E%0A%3CP%3E%3CBR%20%2F%3EAnd%20the%20bit%20reversal%20function%20that%20will%20generate%20an%20integer%20value%3A%3C%2FP%3E%0A%3CP%3E%3CBR%20%2F%3EIF%20EXISTS%20(SELECT%20*%20FROM%20sys.objects%20WHERE%20object_id%20%3D%20OBJECT_ID(N'%5Bdbo%5D.%5Bufn_BitReverse%5D')%20AND%20type%20in%20(N'FN'%2C%20N'IF'%2C%20N'TF'%2C%20N'FS'%2C%20N'FT'))%20%3CBR%20%2F%3EDROP%20FUNCTION%20%5Bdbo%5D.%5Bufn_BitReverse%5D%20%3CBR%20%2F%3EGO%20%3CBR%20%2F%3ECREATE%20FUNCTION%20ufn_BitReverse%20(%40InputVal%20int)%20%3CBR%20%2F%3ERETURNS%20int%20%3CBR%20%2F%3EWITH%20SCHEMABINDING%20%3CBR%20%2F%3EAS%20%3CBR%20%2F%3EBEGIN%20%3CBR%20%2F%3EDECLARE%20%40WorkValue%20int%20%3D%20%40InputVal%20%3CBR%20%2F%3EDECLARE%20%40Result%20int%20%3D%200%3B%20%3CBR%20%2F%3EDECLARE%20%40Counter%20tinyint%20%3D%200%3B%20%3CBR%20%2F%3EWHILE%20%40Counter%20%26lt%3B%2031%20--%2063%20for%20bigint%20%3CBR%20%2F%3EBEGIN%20%3CBR%20%2F%3ESET%20%40Result%20%3D%20%40Result*2%20%3CBR%20%2F%3EIF%20(%40WorkValue%26amp%3B1)%20%3D%201%20%3CBR%20%2F%3EBEGIN%20%3CBR%20%2F%3ESET%20%40Result%20%3D%20%40Result%2B1%20%3CBR%20%2F%3ESET%20%40WorkValue%20%3D%20%40WorkValue-1%20%3CBR%20%2F%3EEND%20%3CBR%20%2F%3ESET%20%40WorkValue%20%3D%20%40WorkValue%2F2%20%3CBR%20%2F%3ESET%20%40Counter%20%3D%20%40Counter%2B1%20%3CBR%20%2F%3EEND%20%3CBR%20%2F%3ERETURN%20%40Result%20%3CBR%20%2F%3EEND%3B%20%3CBR%20%2F%3EGO%3C%2FP%3E%0A%3CP%3E%3CBR%20%2F%3EAnd%20a%20new%20table%20for%20this%20test%2C%20which%20is%20the%20very%20same%20as%20our%20initial%20table%3A%3C%2FP%3E%0A%3CP%3E%3CBR%20%2F%3EIF%20EXISTS%20(SELECT%20*%20FROM%20sys.objects%20WHERE%20object_id%20%3D%20OBJECT_ID(N'dbo.HeavyInsert_BitReversal')%20AND%20type%20in%20(N'U'))%20%3CBR%20%2F%3EDROP%20TABLE%20dbo.HeavyInsert_BitReversal%20%3CBR%20%2F%3EIF%20NOT%20EXISTS%20(SELECT%20*%20FROM%20sys.objects%20WHERE%20object_id%20%3D%20OBJECT_ID(N'dbo.HeavyInsert_BitReversal')%20AND%20type%20in%20(N'U'))%20%3CBR%20%2F%3ECREATE%20TABLE%20dbo.HeavyInsert_BitReversal(%20%3CBR%20%2F%3EID%20int%20NOT%20NULL%20%3CBR%20%2F%3E%2C%20col1%20VARCHAR(50)%20NOT%20NULL)%20%3CBR%20%2F%3EGO%20%3CBR%20%2F%3E%3CBR%20%2F%3ECREATE%20UNIQUE%20CLUSTERED%20INDEX%20CIX_BitReversal%20%3CBR%20%2F%3EON%20dbo.HeavyInsert_BitReversal%20(ID)%20%3CBR%20%2F%3EGO%3C%2FP%3E%0A%3CP%3E%3CBR%20%2F%3EThe%20integer%20value%20generated%20by%20the%20function%20will%20be%20used%20during%20the%20inserts%2C%20and%20conceptually%20it%20is%20random%20enough%20to%20spread%20out%20the%20inserts%20by%20different%20pages.%20So%20we%20have%20to%20get%20the%20next%20value%20for%20the%20sequence%2C%20and%20use%20it%20in%20the%20insert%20statement%3A%3C%2FP%3E%0A%3CP%3E%3CBR%20%2F%3EDECLARE%20%40value%20int%20%3CBR%20%2F%3EDECLARE%20%40i%20int%20%3D%201%20%3CBR%20%2F%3EWHILE%20%40i%20%26lt%3B%20100000%20%3CBR%20%2F%3EBEGIN%20%3CBR%20%2F%3ESELECT%20%40value%20%3D%20NEXT%20VALUE%20FOR%20dbo.seqAdvWorks%20%3CBR%20%2F%3EINSERT%20INTO%20dbo.HeavyInsert_BitReversal%20(ID%2Ccol1)%20%3CBR%20%2F%3ESELECT%20dbo.ufn_BitReverse(%40value)%2C'testing%20heavy'%20%3CBR%20%2F%3ESET%20%40i%20%2B%3D%201%20%3CBR%20%2F%3EEND%3B%20%3CBR%20%2F%3EGO%3C%2FP%3E%0A%3CP%3E%3CBR%20%2F%3EOnce%20the%20workload%20is%20running%20on%20the%20120%20sessions%2C%20while%20checking%20for%20contention%20we%20can%20see%20that%20PAGELATCH_EX%20contention%20is%20occurring%20on%20resource%209%3A1%3A24273%3A%20%3CBR%20%2F%3E%3CBR%20%2F%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20919px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F97745iB031E41D86D2EB75%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20%2F%3E%3C%2FSPAN%3E%3CBR%20%2F%3E%3CBR%20%2F%3EWhat%20we%20can%20also%20determine%2C%20for%20example%20looking%20at%20spid%20163%2C%20is%20that%20the%20running%20statement%20during%20the%20latch%20contention%20is%20the%20NEXT%20VALUE%20FOR%20sequence.%20Using%20DBCC%20PAGE%2C%20we%20can%20see%20that%20the%20object%20id%20is%2060%2C%20which%20is%20the%20%3CA%20href%3D%22http%3A%2F%2Fmsdn.microsoft.com%2Fen-US%2Flibrary%2Fms179503.aspx%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3Esysobjvalues%20%3C%2FA%3Esystem%20table.%20This%20table%26nbsp%3Bis%20used%20to%20hold%20metadata%20while%20accessing%20the%26nbsp%3Bsequence%26nbsp%3Bto%20get%20the%20current%20value.%20%3CBR%20%2F%3E%3CBR%20%2F%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20703px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F97746iE949210373601DCD%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20%2F%3E%3C%2FSPAN%3E%20%3CBR%20%2F%3E%3CBR%20%2F%3ESo%20it%20seems%20that%20we%20are%20not%20incurring%20in%20PAGELATCH_EX%20waits%20in%20the%20data%20insertion%20itself%2C%20but%20while%20getting%20the%20next%20value%20for%20the%20sequence.%20That%20can%20be%20resolved%20using%20the%20sequence%20cache%20for%20a%20large%20value%2C%20like%20below%3A%3C%2FP%3E%0A%3CP%3E%3CBR%20%2F%3EIF%20EXISTS%20(SELECT%20*%20FROM%20sys.objects%20WHERE%20object_id%20%3D%20OBJECT_ID(N'dbo.seqAdvWorks')%20AND%20type%20in%20(N'SO'))%20%3CBR%20%2F%3EDROP%20SEQUENCE%20dbo.seqAdvWorks%20%3CBR%20%2F%3EIF%20NOT%20EXISTS%20(SELECT%20*%20FROM%20sys.objects%20WHERE%20object_id%20%3D%20OBJECT_ID(N'dbo.seqAdvWorks')%20AND%20type%20in%20(N'SO'))%20%3CBR%20%2F%3ECREATE%20SEQUENCE%20dbo.seqAdvWorks%20AS%20int%20%3CBR%20%2F%3ESTART%20WITH%201%20%3CBR%20%2F%3EINCREMENT%20BY%201%20%3CBR%20%2F%3ESTART%20WITH%201%20%3CBR%20%2F%3ECACHE%2010000%20%3CBR%20%2F%3EGO%3C%2FP%3E%0A%3CP%3E%3CBR%20%2F%3EWe%20have%20set%20the%20value%20at%2010%2C000%20(mileage%20may%20vary)%20and%20this%20way%20we%20will%20have%20less%20frequent%20access%20to%20the%20%3CA%20href%3D%22http%3A%2F%2Fmsdn.microsoft.com%2Fen-US%2Flibrary%2Fms179503.aspx%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3Esysobjvalues%20%3C%2FA%3Esystem%20table.%20%3CBR%20%2F%3E%3CBR%20%2F%3ERunning%20the%20same%20insert%20workload%20we%20have%20no%20visible%20contention%20as%20before.%20For%20the%20same%2011%2C999%2C880%20inserted%20records%2C%20the%20cycle%20took%20a%20little%20over%204%20minutes%20(04%3A00.961)%2C%20so%20I%20find%20this%20to%20be%20an%20elegant%20solution%20for%20addressing%20PAGELATCH_EX%20contention%20in%20this%20scenario.%20%3CBR%20%2F%3E%3CBR%20%2F%3EAs%20a%20summary%2C%20if%20we%20analyze%20the%20%3CA%20href%3D%22http%3A%2F%2Fmsdn.microsoft.com%2Fen-us%2Flibrary%2Fms190732.aspx%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3EWait%20Statistics%3A%20Page%20Latch%20waits%20%3C%2FA%3Eperformance%20counter%20for%20the%20duration%20of%20the%20tests%2C%20we%20find%20that%20while%20the%20hash%20partitioning%20scenario%20provides%20better%20performance%2C%20the%20bit%20reversal%20gets%20the%20lowest%20PAGELATCH%20waits.%3C%2FP%3E%0A%3CTABLE%3E%0A%3CTBODY%3E%0A%3CTR%3E%0A%3CTD%3E%26nbsp%3B%3C%2FTD%3E%0A%3CTD%3E%3CBR%20%2F%3E%3CP%3EMin%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%3E%3CBR%20%2F%3E%3CP%3EAvg%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%3E%3CBR%20%2F%3E%3CP%3EMax%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%3E%3CBR%20%2F%3E%3CP%3ETime%20(mi%3Ass.ms)%3C%2FP%3E%0A%3C%2FTD%3E%0A%3C%2FTR%3E%0A%3CTR%3E%0A%3CTD%3E%3CBR%20%2F%3E%3CP%3EHeavyInsert%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%3E%3CBR%20%2F%3E%3CP%3E0%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%3E%3CBR%20%2F%3E%3CP%3E226%2C726%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%3E%3CBR%20%2F%3E%3CP%3E339%2C493%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%3E%3CBR%20%2F%3E%3CP%3E05%3A20.623%3C%2FP%3E%0A%3C%2FTD%3E%0A%3C%2FTR%3E%0A%3CTR%3E%0A%3CTD%3E%3CBR%20%2F%3E%3CP%3EHeavyInsert_Hash%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%3E%3CBR%20%2F%3E%3CP%3E0%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%3E%3CBR%20%2F%3E%3CP%3E14%2C424%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%3E%3CBR%20%2F%3E%3CP%3E52%2C879%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%3E%3CBR%20%2F%3E%3CP%3E02%3A13.055%3C%2FP%3E%0A%3C%2FTD%3E%0A%3C%2FTR%3E%0A%3CTR%3E%0A%3CTD%3E%3CBR%20%2F%3E%3CP%3EHeavyInsert_BitReversal%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%3E%3CBR%20%2F%3E%3CP%3E0%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%3E%3CBR%20%2F%3E%3CP%3E2%2C124%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%3E%3CBR%20%2F%3E%3CP%3E13%2C003%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%3E%3CBR%20%2F%3E%3CP%3E04%3A00.961%3C%2FP%3E%0A%3C%2FTD%3E%0A%3C%2FTR%3E%0A%3C%2FTBODY%3E%0A%3C%2FTABLE%3E%0A%3CP%3E%3CBR%20%2F%3EHope%20you%20find%20it%20useful!%20%3CBR%20%2F%3E%3CBR%20%2F%3EPedro%20Lopes%20(%20%3CA%20href%3D%22https%3A%2F%2Ftwitter.com%2FSQLPedro%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noreferrer%22%3E%40SQLPedro%20%3C%2FA%3E)%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-TEASER%20id%3D%22lingo-teaser-384289%22%20slang%3D%22en-US%22%3E%3CP%3EFirst%20published%20on%20MSDN%20on%20May%2023%2C%202013%20Hello%20all%2CRecently%20I%20came%20across%20an%20issue%20over%20a%20table%20that%20was%20being%20inserted%20into%20quite%20intensively%2C%20by%20concurrent%20operations.%3C%2FP%3E%3C%2FLINGO-TEASER%3E%3CLINGO-LABS%20id%3D%22lingo-labs-384289%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3ESQLServerTiger%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E
Version history
Last update:
‎Apr 07 2019 05:38 PM
Updated by: