Delegation Rules: ORDER BY

  1. ORDER BY can be delegated to a data source provider if the data provider supports it.
  2. ORDER BY can be delegated only if the entire query can be delegated.
  3. ORDER BY can be delegated only when it contains a column name or an index that points to a column name. Only one column or alias will be delegated. If there is more than one column in the ORDER BY, the left-most column will be delegated.
  4. ORDER BY cannot be delegated if it contains a function or operator.
  5. If the data source provider supports ORDER BY but does not support GROUP BY, the delegated query will return an ORDER BY with the column to be grouped by.
  6. ORDER BY can be delegated regardless of which parts of the WHERE clause are delegated to the data source provider. This applies to non-aggregating queries only.