Question : I have a database (from a vendor application) that for some unknown reason has a UDDT on almost […]
Tag: cardinality-estimates
How to correct row estimates due to join of 2 well-estimated results
Question : The following query runs across ~60 databases in parallel. Without hints there are numerous spills and non-optimal plans […]
Ascending keys getting bad plans in SQL 2016 (new CE), replacement for TF 4139 et al.?
Question : The new cardinality estimator (CE) in SQL Server 2016 has an unfortunate regression which hits our deployment hard. […]
Does WITH SCHEMABINDING on a multi-statement TVF improve cardinality estimates?
Question : Based on Query Performance and multi-statement table valued functions and other articles, SQL Server assumes that a multi-line […]
Nested Loop has very low estimates due to skewed data
Question : On SQL Server 2016 SP2 we have a query that has a very low estimate on the nested […]
Type conversion in expression try_cast may affect cardinality estimate in query plan choice
Question : I have a query that is running very slow so I started looking into the Execution Plan. TRY_CAST […]
What are thresholds in SQL Server 2014 “big table join to small table” cardinality estimation optimization?
Question : The SQL Server 2014 Cardinality Estimator white paper says: The new CE, however, uses a simpler algorithm that […]
Stream Aggregate for Sort?
Question : Trying to understand Couple of things in the above query plan. Why is there a Stream Aggregate in […]
How does the optimizer treat yet-unpopulated #temp tables when estimating cardinality?
Question : I’ve been building stored procedures and can’t find any documentation on how the SQL Server optimizer handles #temp […]
Hash join between master/detail tables produces too-low cardinality estimate
Question : When joining a master table to a detail table, how can I encourage SQL Server 2014 to use […]