HPlogo ALLBASE/SQL Performance and Monitoring Guidelines: HP 9000 Computer Systems > Chapter 3 Guidelines on Query Design

Using MIN/MAX Functions in Predicates

» 

Technical documentation

Complete book in PDF
» Feedback

 » Table of Contents

 » Index

An index scan may be used for a query containing a single MIN() or MAX() function in the select list if an index exists on the column the function is applied to, and if the function is applied to the first column in the index. The index scan is considered for queries with or without predicates, including MIN() or MAX() on a join column in a nested loop join, provided the MIN() or MAX() is applied to a column in the outermost table.

An index scan plan for MIN() or MAX() cannot be considered for queries in which there is an expression, an ORDER BY or GROUP BY clause, or where tables are joined using the sort/merge join method.

Feedback to webmaster