I just wrapped a complex SQL statement in a table function on SQLServer 2000. When I look at the query plan for SELECT * FROM dbo.NewFunc it just gives me a scan of the table from the table I created.
I assume this is because the table is created in tempdb, and I just select it.
So the request is simple:
SELECT * FROM table in tempdb
My questions:
Is UDF the same plan as a complex SQL statement?
How to configure indexes for this UDF?
Is it possible to see the true plan?
source
share