Details
-
Task
-
Status: Open (View Workflow)
-
Major
-
Resolution: Unresolved
-
None
-
None
Description
Non-Deterministic functions in a WHERE are re-executed for every potential matching row.
For cases where I believe the result of a function will not change while a query is currently running, it would be nice to be able to mark it as being somewhere being between deterministic and non-deterministic.
This is useful for cases where the result of the function depends on other tables or server variables but you still know, the result will not change for the current select, e.g. for cases, where you could normally do "set @variable=function(); SELECT .... WHERE @variable = 123"
Marking such a function as fully deterministic will speed up the query correctly, but might have unintended side effects on other parts of the system (for example binlogging).