Internal sorting in Magic xpa is very costly. It is always best to ask the RDBMS to sort the data and to supply the records in the required order to Magic xpa. This is done by using the Sort Using RDBMS feature.