Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Performance switched with parameter
Message
From
23/09/2014 15:29:40
 
 
General information
Forum:
Microsoft SQL Server
Category:
Indexing
Environment versions
SQL Server:
SQL Server 2012
Application:
Web
Miscellaneous
Thread ID:
01607903
Message ID:
01608110
Views:
42
>Michel, if you're getting the same performance and the same usage of the index, and the only difference is a paired set of compute scalar/constant scans for each variable in the execution plan, then I can say with confidence that the difference is insignificant.
>
>Again, when you use variables instead of literals in the WHERE clause (and I'm not even talking about parameters, just plain variables), SQL Server has to take an extra tiny step to evaluate the variables and then create an internal "constant row".
>
>The execution plan might really "look wonky" compared to using literals, especially if you have many variables - but because the total cost of all those additional operators is so small relative to the entire query cost, it's nothing to be concerned about. It's simply the way SQL Server works.

Thanks, but a lot of times, the execution plan does not show those scalar/constant scans. This is why I started to investigate as I found that weird that I suddenly observed that.
Michel Fournier
Level Extreme Inc.
Designer, architect, owner of the Level Extreme Platform
Subscribe to the site at https://www.levelextreme.com/Home/DataEntry?Activator=55&NoStore=303
Subscription benefits https://www.levelextreme.com/Home/ViewPage?Activator=7&ID=52
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform