In a repartitioned join, the partitioning keys of the files are not used as the join fields.
Records of both files must be moved by hashing the join field values of each of the files. Because neither of the files' partitioning key fields are included in the join criteria, the files must be repartitioned by hashing on a new partitioning key that includes one or more of the join fields. This method is valid only for equijoin queries.
SQL statement:
SELECT DEPTNAME, FIRSTNME, LASTNAME FROM DEPARTMENT, EMPLOYEE WHERE MGRNO = EMPNO
OPNQRYF command:
OPNQRYF FILE((DEPARTMENT) (EMPLOYEE)) FORMAT(JOINFMT) JFLD((MGRNO EMPNO *EQ))
In this example, the data must be redistributed because neither MGRNO nor EMPNO is a partitioning key.
Data from DEPARTMENT is redistributed:
|
Data from EMPLOYEE is redistributed:
|
Records returned by this query:
|