You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Some function translations apply arithmetic to arguments/return values; when the operands happen to be constants, we can simply compute the result in post-translation and embed the result constant.
See #28031 for an example with SQL Server's string.IndexOf.
It may be a good idea to do some non-arithmatic evaluation as well (IIRC there's some logical optimization happening in SqlNullabilityProcessor, which may make more sense in a general optimizing visitor or something).
The text was updated successfully, but these errors were encountered:
Note: we've starting some optimizations in SqlExpressionFactory, when expressions are originally constructed; this applies the optimization very early (good), possibly unlocking other optimizations. Constant arithmetic evaluation probably falls under this umbrella too: if the operands of the unary/binary expression happen to be constants, just evaluate and return the response.
Some function translations apply arithmetic to arguments/return values; when the operands happen to be constants, we can simply compute the result in post-translation and embed the result constant.
See #28031 for an example with SQL Server's string.IndexOf.
It may be a good idea to do some non-arithmatic evaluation as well (IIRC there's some logical optimization happening in SqlNullabilityProcessor, which may make more sense in a general optimizing visitor or something).
The text was updated successfully, but these errors were encountered: