In most of the DB2 manuals, it is recommended to use parameter markers for dynamic SQL statements. If I modify COBOL applications to use parameter markers instead of new literals each time, will it help in improving the overall performance of the applications. Also, if I start using parameter markers, would it be judicious to increase the existing size of EDM pool to make effective use of dynamic statement caching?
Parameter markers are the easiest way to implement "host variable" like processing with dynamic SQL. One of the benefits of using a parameter marker instead of a literal is that DB2 can continue to use the mini-plan in the EDM pool if you are using dynamic statement caching (DSC). For DSC to work, the dynamic SQL statement has to be EXACTLY the same each time it is run. Changing the literal value changes the SQL statement and requires a rebind. Of course, you might want that if you expect the access path to change based on skewed values.
Start the conversation
0 comments