cerberis wrote:
Otis wrote:
The reason this is done is to make sqlserver re-use queries more. A query is converted into an execution plan and based on the exact sql string, it's cached. If a query changes based on parameters, it could be that the query is compiled into a new execution plan while this shouldn't have been the case.
It also makes queries smaller.
In our upcoming profiler (separate tool) you can easily watch the queries and replace parameters with the real values.
We won't go back to the original names, sorry
I think string does not change in both naming cases..
it might. Not all parameters are constructed from field names, as sometimes a parameter is constructed from variables in an expression in a linq query. This led to artificial names with hashes to make them unique, but this actually led to plan trashing in some situations. We therefore created a simpler system, which never has this problem.
"Makes query smaller.."
maybe it makes some microseconds to send faster over the network..
If you use a lot of parameters, lots of long names, and lots of queries it adds up.
Anyway, to implement small switch in config file and let choose to customer wont be very hard, or?
It actually is less simple than you think. The parameters have to be created from field names, which isn't always available. To add code to make things worse, no, we won't do that.