Skip to content

Do not cache query plan with non-parameterized constants. #1544

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

Merged

Conversation

fredericDelaporte
Copy link
Member

@fredericDelaporte fredericDelaporte commented Jan 20, 2018

This is a simpler alternate solution than #1542, and complete: no workaround is required for any case. This would obsolete #1540 by the way, as would do #1542.

Vs #1542, pros:

Cons:

  • Would never cache plan for queries having non-parameterized constants. If such queries are called many times with same non-parameterized constants values, their execution would be slightly slower. (But it should not be a significant performance hit in the case of a query going to DB, the db querying would still take most of the overall execution time.)

The "deluxe" solution would be to combine #1540 and #1542, defaulting to #1542 behavior (safer) with an option for enabling #1542 behavior (documented as potentially causing object instances caching and reuse). But I do not think this would be worth the additional code for supporting it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants