Tips for grouping with an index implementation

This implementation utilizes an index to perform the grouping optimization. An index is required that contains all of the grouping columns as contiguous left-most key columns. The database manager accesses the individual groups through the index and performs the requested summary functions.

Since the index, by definition, already has all of the key values collated together, the first group result can be returned in less time than the hashing method. This is because of the temporary result that is required for the grouping hash method. This implementation can be beneficial if an application does not need to retrieve all of the group results, or if an index already exists that matches the grouping columns.

For more information, see Database Performance and Query Optimization in the Information Center Link to Information center.