Skip to content

DB2 LUW Case Sensitivity

December 1, 2014

Every now and again I come across a problem query that involves case sensivity. I noticed a steady increase in CPU usage of about 5% since this past Thursday. Suspecting a code change was introduced unbeknownst to me, I had one of my guys take a look. We found a query running with a LOWER function in the where-clause. This was an often executed query and the optimizer had chosen a table scan. So knowing how to fix this from years of experience, we created a generated column on the column in question and voila, index only access! Problem fixed. This is 9.7, in 10.5 we can create a function-based index also. This is a link to a nice Developer works article by a friend from the lab. http://www.ibm.com/developerworks/data/library/techarticle/0203adamache/0203adamache.html

From → Uncategorized

Leave a Comment

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: