SQL Quality Control workload analysis illustration

UBS HAINER SQL QUALITY CONTROL · DB2 FOR Z/OS

SQL Quality Control: Db2 for z/OS performance, stability and MSU cost control

SQL Quality Control analyzes Db2 for z/OS SQL workloads, indexes and buffer pools, identifies where CPU, zIIP, I/O and elapsed time are consumed, and recommends the changes that reduce them. Lower general-purpose CPU consumption reduces the MSU charge, the metered capacity figure mainframe software is billed on, and shorter wait times return capacity to the transactions behind the statement.

SQL behavior, access paths, SQL errors and buffer pools share one history, so tuning decisions rest on weeks and months of recorded data, not a single moment.

1,500 → 120

MSUs per day, one statement

Found at REWE digital on day one and corrected with a single SQL change.

Long-term statement history

Each statement is identified by a hash of its text, so the same statement is recognized on every execution and CPU and zIIP growth, wait times and access path changes read as trends.

Statements and buffer pools, linked

Each buffer pool is linked to the tables, indexes and statements using it, so I/O pressure is traced to the workload that causes it.

SQL Quality Control in Brief

What it covers, how it differs from a real-time monitor, and who runs it.
1

What is SQL Quality Control?

SQL Quality Control is a Db2 for z/OS performance optimization product. It keeps a long-term history of static and dynamic SQL, access paths, SQL errors and buffer pools, and recommends the SQL, index and buffer pool changes that reduce CPU and zIIP consumption, I/O and elapsed time.
2

How is it different from a real-time Db2 monitor?

A real-time monitor shows what a statement or buffer pool is doing now. SQL Quality Control tracks both over time, so CPU and zIIP consumption, wait times, access paths and buffer pool health carry a history. Monitors remain appropriate for incident response; the two are complementary.
3

Who runs it, and at what scale?

Db2 administrators, application developers and z/OS operations teams at insurers, banks, retailers, telecommunications providers and public administrations, at workload volumes up to 140 billion SQL executions per day.

How SQL Quality Control Works

Four stages turn collected SQL and buffer pool data into a ranked set of changes. Collection runs continuously, and each stage builds on the last, so the analysis improves as the history lengthens.
Step 1
Collect the workload

Collect the workload

Static and dynamic SQL is collected together with its runtime behavior: CPU and zIIP consumption, elapsed time, I/O, and Class 3 wait times, the intervals a statement spends waiting on locks, I/O and log rather than working. Buffer pool and group buffer pool metrics are collected alongside.
Step 2
Explain and record access paths

Explain and record access paths

The access path of each statement is determined and retained. When Db2 selects a different plan, the change is recorded alongside the CPU and zIIP consumption that followed.
Step 3
Analyze and recommend

Analyze and recommend

New or modified indexes are recommended, AI analysis explains why a statement is expensive, including SQL rewrites, and buffer pool issues are flagged by severity with recommended settings. Recommendations are ranked by cost.
Step 4
Verify before implementation

Verify before implementation

A recommended index is simulated based on the historical workload to estimate the impact before it is created.

SQL Quality Control at a Glance

What it collects, where it stores it, and how it is presented.

PlatformDb2 for z/OS
Scope of analysisStatic and dynamic SQL statements, access paths, indexes, SQL errors and warnings, buffer pools and group buffer pools
Metrics per statementGeneral-purpose CPU and zIIP consumption, elapsed time, I/O, and Class 3 wait times for locks, I/O and log
Statement identificationA hash of the statement text, which allows tracking across executions
Access path dataThe Db2 EXPLAIN result is retained per statement, producing an access path history
Index functionsRecommendation, simulation before creation, verification of automatic proposals, and identification of indexes not worth keeping
Error dataSQL errors and warnings from Db2 performance traces, with correlation ID, connection type, plan, program, statement and SQLCA
Buffer pool dataBuffer pool and group buffer pool metrics: hit ratios, page residency time, deferred writes and prefetch efficiency, with issues flagged by severity, plus recommended pool sizes, threshold settings and object assignments with generated ALTER statements
Data storageDb2 tables
User interfaceGrafana dashboards, filterable by time interval, user, transaction, plan and program
ComponentsSeven: Data Collector, Explainer, Index Advisor, Virtual Workload, Error Detector, Buffer Pool Tuning (based on BPA4Db2), and Performance Insights with AI Analysis
Largest reported installationApproximately 140 billion SQL executions per day across a 14-member data sharing group, with low performance impact

Supported Db2 for z/OS and z/OS release levels and installation prerequisites are supplied by UBS Hainer on request.

AI QUERY ANALYSIS

AI-assisted analysis of expensive SQL statements

An expensive statement arrives with a first-pass diagnosis already attached. AI Query Analysis correlates its runtime history with its access paths, table and index metadata and column statistics, then reports the likely performance problem in actionable terms.

The output is a structured first-pass analysis: what appears to be wrong, how urgent it is relative to the rest of the workload, and what to do next, including SQL rewrites and index changes.

Because it draws on recorded history rather than one execution, it distinguishes a statement that has always been expensive from one that became expensive after a plan change.

Complex data reported as tuning actions

History, access paths and statistics are read together and reported as one explanation.

AI-generated SQL rewrites

Next steps include concrete rewrites, not only a description of what is slow.

Prioritization by urgency

Each statement is placed in the context of the wider workload, so tuning work is ordered.

Reduced dependency on specialists

Developers and junior administrators receive the explanation with the recommendation, which makes the work reviewable.

ERROR DETECTOR

SQL errors and warnings, tracked over time

Db2 SQL errors are typically investigated one incident at a time, from whatever evidence remains in a log. The Error Detector monitors performance traces continuously and consolidates errors and warnings across subsystems, users, plans and programs into one view.

Each entry carries the context needed to diagnose it: user, correlation ID, connection type, plan, program, the statement and the SQLCA. Summary and detail data are stored in Db2 tables, so one record serves incident response, audits and SLA documentation.

Read the FAQs

SQL Quality Control Error Detector consolidating Db2 SQL errors and warnings

Measured SQL Quality Control Results

Reported by organizations running SQL Quality Control against their own Db2 for z/OS workloads.

1,500 → 120

MSUs per day for one statement at REWE digital, found on the first day of use.

10–20% → flat

Annual MSU growth at REWE digital, flat since adoption even as the business scales.

140 billion

SQL executions per day at the largest installation, across a 14-member data sharing group.

“Employees are motivated to review CPU usage, assess SQL query performance, and optimize their work with SQL Quality Control.”

– Db2 Administrator, REWE digital GmbH

Organizations Running UBS Hainer Software

Insurers, banks, retailers, telecommunications providers and public administrations across Europe and North America.

More Information About SQL Quality Control

Recorded sessions and reference material on Db2 for z/OS SQL workload analysis, cost attribution and index tuning.

Evaluate SQL Quality Control in your environment

A demonstration applies SQL Quality Control to a customer Db2 for z/OS workload. Contact sales@ubs-hainer.com in Germany or sales@ubs-hainersoftware.com in the US.

Schedule a demo

SQL QUALITY CONTROL FAQS

SQL Quality Control dashboard illustration

Frequently Asked Questions About SQL Quality Control

The questions asked most often about how SQL Quality Control analyzes Db2 for z/OS workloads and reduces their cost.
Ask an expert

SQL Quality Control is a Db2 workload analysis product from UBS Hainer. It analyzes Db2 SQL workloads, pinpoints areas for improvement, and proposes cost-saving changes so teams can optimize SQL and boost application performance.

Application workload is the primary factor driving mainframe operating costs. SQL Quality Control addresses this by identifying tuning opportunities inside SQL applications autonomously, then proposing solutions that reduce CPU and zIIP consumption and improve throughput.

It collects long-term statistics for static and dynamic SQL statements and analyzes them for tuning potential. From that data it detects access path changes, growth in CPU and zIIP consumption per statement, and missing or incorrectly defined indexes.

It tracks CPU and zIIP consumption and associated Class 3 wait times, including I/O, lock, and log waits, along with the access path used at any given time. Each statement carries a history, so changes over time are visible rather than inferred.

Yes. SQL Quality Control investigates the workload and produces index recommendations, including missing and incorrectly defined indexes. A recommended index is simulated based on the historical workload to estimate the impact before it is created.

Yes. SQL Quality Control identifies unnecessary indexes that still carry insert activity, which means they cost CPU and zIIP time on every write without earning their keep on reads. Index usage statistics are part of the standard reporting.

The interface is built on Grafana dashboards and shows which SQL statements carry the highest costs, so tuning effort goes to the statements that matter. It also covers CPU and zIIP consumption, historical performance, access path history, and index usage.

REWE digital reported that on day one it uncovered an SQL statement consuming 1,500 MSUs daily, which was reduced to 120 MSUs after a change. Their usual 10 to 20 percent yearly MSU growth has since stabilized as the business scales.

There are seven: the Data Collector gathers static and dynamic SQL statistics, the Explainer explains collected statements with access path history, the Index Advisor produces index recommendations, Virtual Workload simulates recommended indexes and validates automatic proposals before any index is created, the Error Detector captures SQL errors and warnings from Db2 performance traces, Buffer Pool Tuning analyzes buffer pool and group buffer pool metrics and recommends pool sizes, thresholds and object assignments, and Performance Insights with AI Analysis provides the Grafana-based dashboards for monitoring and analysis.