I'm only nesting a few levels deep. And I know it's like nesting views. And when I execute the function via:
SELECT TOP 1 * FROM dbo.udf_...
or
SELECT COUNT(*) FROM dbo.udf_...
The performance is reasonable. It's when I do the
INSERT INTO <table> SELECT <column-list> FROM dbo.udf_...
that the performance goes to hell well beyond what seems reasonable in comparison to if the same ITVF had been written to utilize # temporary tables that are pulled together using similar logic as what occurs using the nested ITVFs
Respectfully,
Darryll