Apologies if this is a stupid question. We are attempting to convert our multi-statement table valued functions (MSTVFs) to inline table valued functions (ITVFs), to avoid the forced serialization of queries.
I have the following ITVF function (watered down), but the Execution Plan still says it has a Degree of Parallelism of 1. The actual function in question has three basic SELECT statements separated by UNION ALLs.
Have I missed something? How can I avoid forced serialization here?
CREATE FUNCTION dbo.Test (@i int) RETURNS TABLE AS RETURN SELECT @i as [i]; GO SELECT * FROM dbo.Test (2); GO
The instance has he following settings:
- Cost Threshold for Parallelism = 5
- Max Degree of Parallelism = 0