From: Bob Eskelson
To: All
How can I improve the performance of AS/400 multiple file SQL joins? I tried tuning my query to use indexes, but it still takes a while to process. Is there anything I can try to speed it up further?
From: Brian Singleton
To: Bob Eskelson
Sometimes when you have to join several large files with a single dynamic SQL statement, you can optimize all day long and not get the desired level of performance. Another technique to improve performance would be to create an AS/400 logical join file that performs the joins at the system level, meaning the SQL optimizer doesn't have to. Then just change your SQL statement to select from the single logical join file.
Creating a join file allows the system to have the recordset prepared as much as possible before the SQL statement is executed, which may result in a shorter recordset retrieval time. The tradeoff is that each time one of the joined files is updated, performance of that update may suffer a little because of the required update of the join file. You still have to pay the performance penalty somewhere, but it may be better to pay it a little at a time than to wait and pay it all at once while your dynamic recordset is built.
LATEST COMMENTS
MC Press Online