Foxhound is the better* Database Monitor for SQL Anywhere.
*better: More thorough, more relevant, more effective.
...more Alerts, more All Clears, more details, more control in your hands.
|
[Home] | [Table of Contents] | [Previous Section] | [Next Section] |
Breck Carter
Last modified: February 12, 1998
mail to: bcarter@bcarter.com
The Max() and Min() aggregate functions may run faster if there is an index on the column. The example in Figure 16 shows that even though the estimated I/O for the second SELECT is hugely wrong, the PLAN says it all: An index is used instead of a sequential table scan and the actual I/O and time figures are much lower.
Figure 16 - An Index Helps Max()
|
Some restrictions may apply to the use of indexes with Max() and Min(). Try putting the function call all by itself in a separate SELECT rather than combining it with other expressions. The presence of a GROUP BY or WHERE clause may also inhibit optimization.
[Home] | [Table of Contents] | [Previous Section] | [Next Section] |