Related routines

To optimize the execution of your function when it is called in the WHERE clause of a SELECT statement, specify related routines.

If the function returns a Boolean result, specify a commutator and a negator function. These routines can be called instead of the original function if the query optimizer determines that they are faster.

Specify a selectivity function to estimate the percentage of rows that might be returned by your function, given a set of arguments. Use the selectivity function to determine the cost of your function; the query optimizer can determine when it is most efficient to call your function.