Closed Gillardo closed 2 years ago
This could be done, but unless you are using a huge number of parameters, I don't see a big perf gain. It would also be a breaking change for code that depends on the number of parameters generated.
We are generating queries and putting them all together so it's only one database connection, I think this would be a good changed. At the moment it easily generates over 2000 parameters but it's around 4 values
You can override the CreateCommand method on Database.
Another perf issue I can think of is parameter equality. Every time you add a parameter you have to check if it's equal to any of the previously added. That is unless you use something like a hash code.
What do u mean we can override the create command method on database?
Closing as this is a breaking change.
If i create a query and pass in the same parameter value, it generates a new parameter for this. It would be much more efficient if the code only added 1 parameter for each unique value instead.
Can this be done?