Setting the local collating sequence to optimize queries

Administrators can create federated databases with a particular collating sequence that matches a data source collating sequence.

Then for each data source server definition, the COLLATING_SEQUENCE server option is set to 'Y'. This setting tells the federated database that the collating sequences of the federated database and the data source match.

You set the federated database collating sequence as part of the CREATE DATABASE command. Through this command, you can specify one of the following sequences:
  • An identity sequence
  • A system sequence (the sequence used by the operating system that supports the database)
  • A customized sequence (a predefined sequence that the Db2® database system supplies or that you define yourself)

Suppose that the data source is Db2 for z/OS®. Sorts that are defined in an ORDER BY clause are implemented by a collating sequence based on an EBCDIC code page. To retrieve Db2 for z/OS data sorted in accordance with ORDER BY clauses, configure the federated database so that it uses the predefined collating sequence based on the appropriate EBCDIC code page.