-
-
Notifications
You must be signed in to change notification settings - Fork 41
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use same parameter when value is the same #78
Comments
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? |
DbExtensions/src/DbExtensions/Database.cs Line 412 in b2c0965
|
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?
The text was updated successfully, but these errors were encountered: