Sort Access (iSeries)

Sort access is used to order records. Queries that may require ordering include those that specify order by, union or distinct in the SQL statement.

When data is ordered:

  • Another access method (for example an index) is chosen to read and select the data
  • The result is then ordered by the operating system

If a sort is performed because no index exists that can be used to satisfy the ordering, the size of the result set determines whether sort is the best ordering solution. If more than 20% of the records are selected and then sorted, sort provides good performance. If less than 20% of the records are selected and then sorted, consider creating an index that can be used to select and sort the records.