Category: Posts-By-Category

5

Adding a GENERATED ALWAYS Column to a Table

GENERATED ALWAYS can be a blessing or a curse. I’m not talking about identity columns here, but about creating a column that is actually a duplicate of some part of the data to boost performance. Sure, in 10.5 we can do indexes on expressions, but for some clients I have trouble just getting them to go to a supported level,...

IanB 1

Keeping EXPLAIN under control

Have you ever looked at a list of tables in your database, only to see the set of EXPLAIN tables present in two, five or even 10 different developers’ schemas? I don’t know about you, but this drives me crazy. Very few of the developers that I know pay attention to these tables, and many of them are not even...

select2 1

DB2 Administrative SQL Cookbook: Looking at How Current Statistics Are

Current statistics are vital to performance. If I’m encountering a database I haven’t regularly been supporting, and don’t know the maintenance plans and schedules, I frequently query to get an idea of how current they are. Purpose To report the dates of statistics collection and the number of tables statistics were collected for on each date. Usually a small list...

select2 2

DB2 Administrative SQL Cookbook: Finding Problem SQL in the Package Cache

I wrote a developerWorks article on finding problem SQL in your package cache. But I refine and play with my SQL over time, so I thought I’d share the version I’ve been using recently. Purpose To find problem SQL in the Package Cache across several importance performance categories. Computes how bad a particular statement is in comparison to other statements...