The optimizer relies on accurate statistics for your data. If you didn’t set up automatic statistics (give a look here) you must run the utility RUNSTATS to populate your metadata (catalog) with them.
This, of course, assumes that the indices are on the keys(columns) that you are joining on or searching on.
REGISTER or login:
CREATE UNIQUE INDEX CORP.PRODIND
USING STOGROUP GROUP1
PIECESIZE 1 M;
Thanks and regards