Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I observe the performance overhead while inserting into a uniqueidentifier primary key column?

As has been discussed numerous times before and is a known fact - having a clustered index on a uniqueidentifier primary key column, in sql server,will affect performance.

What I would like to do is observe this issue by issuing inserts and measuring certain metrics. I have 2 tables with a uniqueidentifier PK; one with 'newid()' as the default and the other with 'newsequentialid()' as the default value. I plan to insert about a million rows in each and observe the INSERT performance.

What should I be querying for in particular? How can I best observe the performace gain of having sequential GUIDs over random GUIDs? Are there certain system views, stored procedures that give stats about the index page splits and/or other relevant information?

like image 765
alwayslearning Avatar asked Nov 13 '22 01:11

alwayslearning


1 Answers

Although the below link will give the comparision between int and guid, but you can follow the similar approach and give it a try.
https://dba.stackexchange.com/questions/9821/why-do-sequential-guid-keys-perform-faster-than-sequential-int-keys-in-my-test-c

like image 127
NG. Avatar answered Dec 05 '22 22:12

NG.