How It Works: How SQL Server Determines Logical and Physical Processors

Moved from:


SQL Server, as outlined in the following post ( adjusts to various processor configurations.  I have received questions related to how SQL Server accomplishes the alignment on both bare metal and VM installations.


The key is the GetLogicalProcessorInformation API, and the same logic occurs on bare metal and VM based SQL Server installations.   For  Virtual Machine (VM) installations you may need to consult the VM documentation for support capabilities.


SQL Server uses Windows APIs to determine the processors and package interactions.


GetSystemInfo GetLogicalProcessorInformation

The calls to GetLogicalProcessorInformation retrieve the RelationProcessorCore and RelationProcessorPackage details.   Using the returned information SQL Server