@@ -2220,16 +2220,6 @@ FROM ##bou_BlitzCacheProcs b
22202220WHERE b .QueryPlanCost IS NULL
22212221OPTION (RECOMPILE );
22222222
2223- RAISERROR (N ' Checking for forced serialization' , 0 , 1 ) WITH NOWAIT ;
2224- WITH XMLNAMESPACES(' http://schemas.microsoft.com/sqlserver/2004/07/showplan' AS p)
2225- UPDATE ##bou_BlitzCacheProcs
2226- SET is_forced_serial = 1
2227- FROM #query_plan qp
2228- WHERE qp .SqlHandle = ##bou_BlitzCacheProcs .SqlHandle
2229- AND SPID = @@SPID
2230- AND query_plan .exist (' /p:QueryPlan/@NonParallelPlanReason' ) = 1
2231- OPTION (RECOMPILE );
2232-
22332223RAISERROR (N ' Checking for plan warnings' , 0 , 1 ) WITH NOWAIT ;
22342224WITH XMLNAMESPACES(' http://schemas.microsoft.com/sqlserver/2004/07/showplan' AS p)
22352225UPDATE ##bou_BlitzCacheProcs
@@ -2428,22 +2418,6 @@ WHERE SPID = @@SPID
24282418OPTION (RECOMPILE ) ;
24292419
24302420
2431- RAISERROR (N ' Checking for ColumnStore queries operating in Row Mode instead of Batch Mode' , 0 , 1 ) WITH NOWAIT ;
2432- WITH XMLNAMESPACES(' http://schemas.microsoft.com/sqlserver/2004/07/showplan' AS p)
2433- UPDATE ##bou_BlitzCacheProcs
2434- SET columnstore_row_mode = x .is_row_mode
2435- FROM (
2436- SELECT
2437- qs .SqlHandle ,
2438- relop .exist (' /p:RelOp[(@EstimatedExecutionMode[.="Row"])]' ) AS is_row_mode
2439- FROM #relop qs
2440- WHERE [relop].exist(' /p:RelOp/p:IndexScan[(@Storage[.="ColumnStore"])]' ) = 1
2441- ) AS x
2442- WHERE ##bou_BlitzCacheProcs .SqlHandle = x .SqlHandle
2443- AND SPID = @@SPID
2444- OPTION (RECOMPILE ) ;
2445-
2446-
24472421RAISERROR (N ' Checking for computed columns that reference scalar UDFs' , 0 , 1 ) WITH NOWAIT ;
24482422WITH XMLNAMESPACES(' http://schemas.microsoft.com/sqlserver/2004/07/showplan' AS p)
24492423UPDATE ##bou_BlitzCacheProcs
@@ -2543,6 +2517,37 @@ WHERE ##bou_BlitzCacheProcs.SqlHandle = x.SqlHandle
25432517AND SPID = @@SPID
25442518OPTION (RECOMPILE );
25452519
2520+ IF @v >= 11
2521+ BEGIN
2522+
2523+ RAISERROR (N ' Checking for forced serialization' , 0 , 1 ) WITH NOWAIT ;
2524+ WITH XMLNAMESPACES(' http://schemas.microsoft.com/sqlserver/2004/07/showplan' AS p)
2525+ UPDATE ##bou_BlitzCacheProcs
2526+ SET is_forced_serial = 1
2527+ FROM #query_plan qp
2528+ WHERE qp .SqlHandle = ##bou_BlitzCacheProcs .SqlHandle
2529+ AND SPID = @@SPID
2530+ AND query_plan .exist (' /p:QueryPlan/@NonParallelPlanReason' ) = 1
2531+ OPTION (RECOMPILE );
2532+
2533+
2534+ RAISERROR (N ' Checking for ColumnStore queries operating in Row Mode instead of Batch Mode' , 0 , 1 ) WITH NOWAIT ;
2535+ WITH XMLNAMESPACES(' http://schemas.microsoft.com/sqlserver/2004/07/showplan' AS p)
2536+ UPDATE ##bou_BlitzCacheProcs
2537+ SET columnstore_row_mode = x .is_row_mode
2538+ FROM (
2539+ SELECT
2540+ qs .SqlHandle ,
2541+ relop .exist (' /p:RelOp[(@EstimatedExecutionMode[.="Row"])]' ) AS is_row_mode
2542+ FROM #relop qs
2543+ WHERE [relop].exist(' /p:RelOp/p:IndexScan[(@Storage[.="ColumnStore"])]' ) = 1
2544+ ) AS x
2545+ WHERE ##bou_BlitzCacheProcs .SqlHandle = x .SqlHandle
2546+ AND SPID = @@SPID
2547+ OPTION (RECOMPILE ) ;
2548+
2549+ END
2550+
25462551IF @v >= 12
25472552BEGIN
25482553 RAISERROR (' Checking for downlevel cardinality estimators being used on SQL Server 2014.' , 0 , 1 ) WITH NOWAIT ;
@@ -2621,6 +2626,8 @@ AND SPID = @@SPID
26212626OPTION (RECOMPILE ) ;
26222627
26232628/* Trace Flag Checks 2014 SP2 and 2016 SP1 only)*/
2629+ IF @v >= 11
2630+ BEGIN
26242631RAISERROR (N ' Trace flag checks' , 0 , 1 ) WITH NOWAIT ;
26252632;WITH XMLNAMESPACES(' http://schemas.microsoft.com/sqlserver/2004/07/showplan' AS p)
26262633, tf_pretty AS (
@@ -2658,6 +2665,7 @@ FROM ##bou_BlitzCacheProcs p
26582665JOIN #trace_flags tf ON tf .QueryHash = p .QueryHash
26592666WHERE SPID = @@SPID
26602667OPTION (RECOMPILE );
2668+ END
26612669
26622670IF @SkipAnalysis = 1
26632671 BEGIN
0 commit comments