I'm trying to execute an SQL statement against the 400 using ASP. There are over 5 million records in the file.
SELECT HTFCMP, HTFPSE, HTFMFM, HTFMFY, HTFMYR FROM P12569.HBTHT6 WHERE P12569.HBTHT6.HTDTDT BETWEEN 20020909 AND 20020913 AND P12569.HBTHT6.HTFWKC = '6LB'
Executes with no problem and within a second.
If I add a GROUP BY clause to the statement, the AS400 seems to ignore the access path and look throught every single record causing a timeout.
SELECT HTFCMP, HTFPSE, HTFMFM, HTFMFY, HTFMYR FROM P12569.HBTHT6 WHERE P12569.HBTHT6.HTDTDT BETWEEN 20020909 AND 20020913 AND P12569.HBTHT6.HTFWKC = '6LB' GROUP BY HTFCMP, HTFPSE, HTFMFM, HTFMFY, HTFMYR
IBM documentation is not much help. Anyone know anything about this?
Thanks
T Wayman
SELECT HTFCMP, HTFPSE, HTFMFM, HTFMFY, HTFMYR FROM P12569.HBTHT6 WHERE P12569.HBTHT6.HTDTDT BETWEEN 20020909 AND 20020913 AND P12569.HBTHT6.HTFWKC = '6LB'
Executes with no problem and within a second.
If I add a GROUP BY clause to the statement, the AS400 seems to ignore the access path and look throught every single record causing a timeout.
SELECT HTFCMP, HTFPSE, HTFMFM, HTFMFY, HTFMYR FROM P12569.HBTHT6 WHERE P12569.HBTHT6.HTDTDT BETWEEN 20020909 AND 20020913 AND P12569.HBTHT6.HTFWKC = '6LB' GROUP BY HTFCMP, HTFPSE, HTFMFM, HTFMFY, HTFMYR
IBM documentation is not much help. Anyone know anything about this?
Thanks
T Wayman