Finding a key in a clustered index is basically the same with a 4 byte key, 16 byte key, or 160 byte key. The cost of comparing slots with a predicate is just the noise in the total cost of the request (preparation of execution, preparation of the execution context, opening sets of lines, searching for pages, etc.), even if no I / O module is involved.
As long as no one claims that the GUIDs and INTs are on an equal footing, a comparison of just 20 queries will not reveal any differences. One instant you can measure is space: saving 12 bytes per row and per sheet of page with a clustered index plus 12 bytes on each page of the sheet on non-clustered indexes will contain more than a million rows and dozens of tables and indexes. Less space means less IO, improves memory cache performance, improves overall quality, and this can be measured, but you need to measure real loads, not heavy 20 lines.
In the lab, you can measure the difference in download speed between an INT or GUID search, but that should not be your focus. The argument against INT GUID is not controlled by something like a 5% increase in search performance, due to space saving and random randomness leading to fragmentation, and it is very easy to measure the indicators that make a solid case for INT on its own grounds, there is no need to give a search argument of performance.
Remus Rusanu
source share