What’s the main difference between single-row and multi-row inserts? Simply the performance. If you are inserting many rows in a loop via a single-row insert, you call DB2 for every single row, which means you spend some time for the communication with the DB2.
Let’s have a brief look at the MERGE statement implementation in DB2. As I am primarily working on DB2 for z/OS, I will focus on this flavor of DB2. However, if there are any significant differences in the MERGE implementation in DB2 LUW, please share them in comments.
Let’s speak today the database monitoring. DB2 is usually presented as a black box that stores and retrieves data for you. Usually we don’t care much about what is happening inside it. However as soon as a trouble arises, information about its internals becomes critical.