There are performance factors you should consider when developing
queries that use distributed files.
- For the OPNQRYF command and the query API (QQQQRY), specifying
ALWCPYDTA(*OPTIMIZE) allows each node to choose an index or a sort to satisfy
the ordering specified.
- For the OPNQRYF command and the query API (QQQQRY), specifying
ALWCPYDTA(*YES) or ALWCPYDTA(*NO) enforces that each node use an index that
exactly matches the specified ordering fields. This is more restrictive than
the way the optimizer processes ordering for nondistributed files.
- Adding an ORDER BY clause to a DISTINCT select can return records
faster by not requiring a final sort on the requesting system.
- Including all of the fields of the partitioning key in the grouping
fields generally results in one-step grouping, which performs better than
two-step grouping.
- Including all of the fields of the partitioning key in the join
criteria generally results in a collocated distributed join.
- Including all of the fields of the partitioning key in isolatable,
equal record selection generally results in the query being processed on only
one node.
- Including any of the following scalar functions in isolatable,
equal record selection generally results in the query being processed on only
one node:
- NODENAME
- NODENUMBER
- PARTITION