The DataBlade API provides support for you to create the following kinds of special-purpose UDRs to optimize UDR performance:
When you write a UDR, you can provide the query optimizer with the following information to help it determine the best query path for queries that contain the UDR.
If your UDR returns a BOOLEAN value (mi_boolean), it is called a Boolean function. Table 106 shows the kinds of Boolean functions that are useful as filters in a query.
Comparison Condition | Operator Symbol | Associated User-Defined Function |
---|---|---|
Relational operator | =, !=, <>
<, <= >, >= |
equal( ), notequal( ), notequal( )
lessthan( ), lessthanorequal( ) greaterthan( ), greaterthanorequal( ) |
LIKE, MATCHES | None | like( ), matches( ) |
Boolean function | None | Name of a user-defined function that returns a BOOLEAN value |
When you write one of the Boolean functions in Table 106, you can also provide the query optimizer with information about how to best evaluate a filter that consists of the Boolean function. You can define the following UDR-optimization functions for Boolean functions.