Join / Log in
use Access Method Directives like :
In the example above, the access-method directive forces the optimizer to consider an execution path that scans the index on the column.
Are you creating indexes after inserting data into the temp tables? If so, it should save distributions equivalent to UPDATE STATISTICS MEDIUM automatically on the indexed columns, and then probably make better decisions about using the indexes. If necessary, user optimizer directives to steer it:https://www.ibm.com/support/knowledgecenter/SSGU8G_14.1.0/com.ibm.perf.doc/ids_prf_554.htm