diff --git a/SQL Queries/maxdop_calculator.sql b/SQL Queries/maxdop_calculator.sql index 4458356..76d43ba 100644 --- a/SQL Queries/maxdop_calculator.sql +++ b/SQL Queries/maxdop_calculator.sql @@ -64,14 +64,13 @@ END ELSE BEGIN DECLARE @LogicalCPUsPerNumaNode INT = @NumCPUs / @NumaNodes; + IF @LogicalCPUsPerNumaNode <= 16 SET @RecommendedMaxDop = @LogicalCPUsPerNumaNode; + ELSE IF (@LogicalCPUsPerNumaNode / 2) >= 16 + SET @RecommendedMaxDop = 16; ELSE SET @RecommendedMaxDop = @LogicalCPUsPerNumaNode / 2; - - -- Ensure the MAXDOP does not exceed half the number of logical CPUs per NUMA node - IF @RecommendedMaxDop > @LogicalCPUsPerNumaNode / 2 - SET @RecommendedMaxDop = @LogicalCPUsPerNumaNode / 2; END -- Define a table variable to store the results