In SQL Server 2014 CTP2 in the AdventureWorks2012 database, execute the following batch:<\/p>\n
\r\nUSE [AdventureWorks2012];\r\nGO\r\n\r\nSELECT [PersonID], [FirstName], [LastName], [JobTitle], [BusinessEntityType]\r\nFROM [dbo].[ufnGetContactInformation](2)\r\nOPTION (QUERYTRACEON 9481);\u00a0 -- Legacy CE\r\n\r\nSELECT [PersonID], [FirstName], [LastName], [JobTitle], [BusinessEntityType]\r\nFROM [dbo].[ufnGetContactInformation](2)\r\nOPTION (QUERYTRACEON 2312); -- New CE\r\n<\/pre>\nThe first query uses the legacy cardinality estimator and the second query uses the new cardinality estimator.\u00a0\u00a0 Both queries are referencing a multi-statement table valued function.<\/p>\n
Looking at the plan tree view in SQL Sentry Plan Explorer for the legacy CE plan, you\u2019ll see the following (estimating 1 row for the function operators):<\/p>\n