Wednesday, November 11, 2015

NSSQL TIPS #3

Avoid sorting

Avoid sorting of large amounts of data. It takes time and has a negative influence on performance.
Sorting may be used in the following cases:
-       ORDER BY
-       GROUP BY
-       DISTINCT
-       UNION (not with UNION ALL)
-       MERGE JOIN


Avoid re-opening a cursor with a large sort in its access-path. If such a cursor is closed, e.g. due to a COMMIT, then reopening the cursor to continue processing will result in repeating of the sort. This is killing for performance. If possible open the cursor with BROWSE ACCESS outside a TMF transaction.

No comments: