Try OpenEdge Now
skip to main content
SQL Development
Optimizing Query Performance : Understanding optimization : Optimizer phases : Indexes to evaluate MAX/MIN functions
 
Indexes to evaluate MAX/MIN functions
This stage of optimization examines subtrees that contain MIN and MAX aggregate functions. The optimizer checks if any index on the table matches the column specified in the function. If so, it replaces the table scan at the leaf node with an index bracket scan.
The index bracket scan looks up the first or last value of the relevant index key. The first and last values represent the MIN and MAX values, respectively, for ascending indexes, and the MAX and MIN values for descending indexes.
Evaluating aggregate functions without fetching the table rows is not possible for indexed character columns because index entries for character data contain the "sort-weight" form of the column value, not the actual column value.