[MDEV-20541] Implement a flag to show if an expression is non-deterministic Created: 2019-09-09 Updated: 2023-08-24 |
|
| Status: | Stalled |
| Project: | MariaDB Server |
| Component/s: | Optimizer |
| Fix Version/s: | None |
| Type: | Task | Priority: | Major |
| Reporter: | Galina Shalygina (Inactive) | Assignee: | Igor Babaev |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Issue Links: |
|
||||||||
| Description |
|
Deterministic expression is an expression that doesn't use non-deterministic functions. E.g.: LENGTH() function of VARCHAR fields. So, for equal input variables LENGTH() function returns different results. This task is a subtask for MDEV-11588. |
| Comments |
| Comment by Sergei Golubchik [ 2019-09-10 ] |
|
I don't think that's what "non-deterministic" usually means.
"Identical" is stronger than "equal", in particular "a" and "a " are not identical, even if they compare as equal. Being deterministic is an important property, used in generated columns (only deterministic expressions can be used, if the result is stored persistently) and in the optimizer (an index can be used only if the lookup value is deterministic). Could you please find some other term for the property you're interested in? |
| Comment by Sergei Golubchik [ 2019-09-11 ] |
|
igor FYI |
| Comment by Federico Razzoli [ 2023-08-24 ] |
|
WIll you consider deterministic stored functions that are declared as DETERMINISTIC? Currently that flag is ignored in all contexts as far as I know. |