-
Notifications
You must be signed in to change notification settings - Fork 27
Description
When doing inserts in SQL Server we see a lot of LATCH wait states. This is due to threads having to wait while a more or less single-thread constrained insert is being executed. According to the linked whitepaper the reason for this is the sequential primary key we use in Anchor, and a suggested fix is to introduce a composed key, consisting of a small (tinyint) "hash" together with the sequential identity column. Essentially this gives you 256 sequential ranges, where tables can be partitioned by the "hash", and thereby enable parallelism for up to 256 threads when doing inserts.
Need to investigate if there is a natural way to introduce such a "hash" for the anchor identities in Anchor. A sequence of type tinyint can be created that cycles 256 values over which tables can be partitioned. However, we then need 256 independent sequences for the remaining part of the identity.