Quantcast
Viewing all articles
Browse latest Browse all 12198

Statistics differences between IsNull and Coalesce

Be aware that IsNull and Coalesce have differences in the way statistics may be calculated (at least in SQL 2012) $0The Isnull option returned an estimate of 300 rows, whereas coalesce estimated 11830.$0 $0The actual result was 13993 rows$0 $0$0 $0 $0Whilst in this example it has no effect, the statistics may affect other parts of a more complex query.$0 $0$0 $0 $0 $0select count(*) from jvd where$0 $0isnull(Actual, Estimate)>='1900-01-01 00:00:00.000' $0 $0AND isnull(Actual, Est

Viewing all articles
Browse latest Browse all 12198

Trending Articles