Saturday, 2 November 2024

UDX operator in SQL Server execution plan

The UDX (User-Defined extension) operator in an execution plan represents a user-defined function (UDF) or user-defined operation that SQL Server executes as part of a query plan. This operator appears when SQL Server needs to execute code defined by a user, such as a scalar or table-valued function. UDX operators can affect query performance, especially when used in scalar functions.

Icon of UDX Operator

 


 See the example here we are using FOR XML PATH () for Concatenate Rows.

SELECT PC.NAME                             AS [Category],
       
Stuff((SELECT ',' + PSB.NAME AS [text()]
              
FROM   adventureworks2019.production.productsubcategory PSB
              
WHERE  PSB.productcategoryid = PC.productcategoryid
              
FOR xml path('')), 1, 1, '') AS [Sub Categories]
FROM   adventureworks2019.production.productcategory PC 

Run the above query


Read: Concatenate Rows using FOR XML PATH ()

https://bageshkumarbagi-msbi.blogspot.com/2016/05/concatenate-rows-using-for-xml-path.html

 See the execution plan


If we are using JSON or XML function to parse then this operate is generated.

No comments:

Post a Comment

If you have any doubt, please let me know.

Popular Posts