The Danger of FETCH FIRST ROW ONLY

There are a a vast array of things you can do in SQL. But just because you can doesn’t always mean that you should.

I recently ran into an interesting situation with FETCH FIRST ROW ONLY.

How the Problem Manifested

The day after new code was deployed, a production database system that usually runs with 40% CPU utilization or less was suddenly pegged at 100% CPU utilization.… Read the rest

Continue reading »

DB2 Table Scans

What is a table scan?

DB2 has a number of ways of accessing the data it needs, but the most basic one – the one that will always work to get what it needs – is the table scan. A Table scan means that DB2 will read through every single row in a table to get the data it needs.… Read the rest

Continue reading »