Updated on 2024-06-03 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 the GUC parameter enable_immutable_optimization is set to ON and DBCOMPATIBILITY is set to A, if the parameter of the immutable stored procedure is 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), the immutable stored procedure is not executed once per row. The immutable stored procedure is executed once for each row when the input parameter is a row expression. In some scenarios, the immutable stored procedure is executed fewer times, but not just once.