Interpret the qualification descriptor
A qualification descriptor contains the individual qualifications that the WHERE clause specifies. A qualification, or filter, tests a value from a row against a constant value. Each branch or level of a WHERE clause specifies either a function or a Boolean expression.
The WHERE clause might include negation indicators, each of which reverses the result of a particular function.
Qualification descriptors can use parameter descriptors when the WHERE clause contains multiple columns, constants, or expressions.
A SELECT statement that contains an IN condition on a column from a VTI table is passed to the access method as a Boolean expression. The IN condition is rewritten by the SQL optimizer as the equivalent Boolean expression. The resulting Boolean expression is incorporated into the scan qualifier and passed to the access method. For example, the condition col1 IN (value1, value2, value3) is rewritten as ((col1 = value1) OR (col1 = value2) OR (col1 = value3)).
Accessor function | Purpose |
---|---|
mi_qual_nparams() | Determines the number of parameters in a complex qualification |
mi_qual_nquals() | Determines the number of simple functions and Boolean operators in a complex qualification |
mi_qual_qual() | Points to one qualification in a complex qualification descriptor or to the only qualification |
mi_qual_issimple() mi_qual_boolop() |
Determines which of the following qualifications
the descriptor describes:
|
mi_qual_funcid() or mi_qual_funcname() | Identifies a simple function by function identifier or function name |
mi_qual_column() | Identifies the column argument of a function |
mi_qual_constant() | Extracts the value from the constant argument of a function |
mi_qual_negate() | Returns MI_TRUE if the qualification includes the operator NOT |
mi_qual_setvalue() | Sets a MI_VALUE_TRUE or MI_VALUE_FALSE indicator for one qualification in a complex qualification descriptor |
mi_qual_value() | Retrieves the results that mi_qual_setvalue() set for a previous qualification Until the qualification sets a result, this function returns the initial value, MI_VALUE_NOT_EVALUATED. |