Natively Compiled Procedures and Bad Execution Plans

SQL Server 2014
I've been exploring how natively compiled procedures are portrayed within execution plans. There have been two previous posts on the topic, the first discussing the differences in the first operator, the second discussing the differences everywhere else. Now, I'm really interested in generating bad execution plans. But, the interesting thing, I wasn't able to, or, rather, I couldn't see evidence of plans changing based on silly things I did to my queries and data. To start with, here's a query: [crayon-5a6d1d5e7d8ef707391608/] And this is a nearly identical query, but with some stupid stuff put in: [crayon-5a6d1d5e7d8fd820737825/] I've change the primary filter parameter value to a VARCHAR when the data is NVARCHAR.┬áThis difference is┬álikely to lead to differences in an execution plan, although not necessarily. If I load my tables up…
Read More