Updated on 2024-05-07 GMT+08:00

Functions and Operators

Operators can be used to process one or more operands and can be placed before, after, or between operands. Results are returned after the processing.

Functions encapsulate service logic to implement specific functions. A function may or may not have parameters. After a function is executed, the result is returned.

Users can modify system functions. However, after the modification, the meaning of the functions may change, which results in disorder in system control. Therefore, users are not allowed to manually modify system functions.

  • When the GUC parameter behavior_compat_options contains the 'enable_funcname_with_argsname' option, the projection alias displays the complete function.
  • When the GUC parameter enable_volatile_match_index is set to ON and DBCOMPATIBILITY is set to A, volatile functions can match indexes. The volatile functions may not hit partial indexes. If there are implicit conversions during function execution, the volatile functions may not hit indexes. In the scenario where indexes cannot be hit, if this option is enabled, the volatile functions still cannot hit the indexes.
  • When DBCOMPATIBILITY is set to A and a constant or an expression that can be converted into a constant (for example, it can be an immutable function, but cannot be a stable or volatile function) is transferred during the execution of the immutable stored procedure in the SQL statement, the immutable stored procedure is not executed once per row. When the input parameter of the immutable stored procedure is a row expression, the stored procedure is executed once per row. In the SQL statements that contain UNION, UNION ALL, and ORDER BY, the number of execution times of the immutable stored procedure decreases but the stored procedure is not executed only once.