Scenario – your query is performing poorly. You see DB2 picked an access path that is less than optimal. First you make sure there are appropriate indexes. You look to see if the statement is written in a way that enables DB2 to use those indexes. Then you check the Filter Factors of the predicates.
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.
April 2015 “Fun with SQL” Challenge 2
This month on the Content Committee blog we’ll be doing an online version of the “Fun with SQL” dojo. Each week we’ll present an SQL challenge and request the community to solve it.
IDUG is dedicated to the support of not only database administrators, but also developers who use our databases. This means that we’re dedicated to sharing information about the many features of SQL and of DB2 in particular. Why is this important? Well, for some very basic reasons.