Click here to view and discuss this page in DocCommentXchange. In the future, you will be sent there automatically.

SQL Anywhere 10.0.1 » SQL Anywhere Server - SQL Usage » Query Optimization and Execution » Query execution algorithms » Duplicate elimination algorithms

Hash Distinct algorithm Next Page

Ordered Distinct algorithm


If the input is ordered by all the columns, then the Ordered Distinct algorithm can be used. This algorithm reads each row and compares it to the previous row. If it is the same, it is ignored; otherwise, it is output. The Ordered Distinct algorithm is effective if rows are already ordered (perhaps because of an index or a merge join); if the input is not ordered, the optimizer inserts a sort. No work table is used by the Ordered Distinct itself, but one is used by any inserted sort.