Support Article
Perfomance issue with the SLA Query
SA-20787
Summary
A systems admin has monitored database performance, and has observed exceptionally poor performance on one specific SQL statement. Request assistance analyzing the SQL and providing recommendations to resolve. DBMS is Oracle.
Error Messages
There are no error messages on the screen, and no applicable error messages in the Pega log.
However, the Pega ALERT log is rife with the PEGA0005 alert against stored procedure sppr_sys_reservequeueitem_b.
Closer examination of the customer identified SQL:
SELECT
PZINSKEY
FROM
(
SELECT
PZINSKEY
FROM
PWPBPM.PR_SYS_QUEUE_SLA
WHERE
PYITEMSTATUS = ? AND
PYAGENTNAME = ? AND
PYMINIMUMDATETIMEFORPROCESSING <= ?
ORDER BY
PZINSKEY ASC
)
WHERE ROWNUM <= 10
Reveals that the SOURCE of this SQL statement is indeed from the stored procedure - specifically, the second half of the stored procedure code generates this specific SQL.
Steps to Reproduce
Unknown. This issue is observed throughout the lifetime of the JVM instance - from startup to shutdown. No specific steps were found to trigger the issue.
Root Cause
The root cause is two fold:
- a previously identified problem in the ORDER BY clause of stored procedure sppr_sys_reservequeueitem_b.
- a fault in Pega code: sometimes calls to this stored procedure are incorrectly generated - missing a TABLE_NAME parameter in the call.
Resolution
To resolve this issue:
- Alter the stored procedure ORDER BY clause:
FROM:
(stored procedure line 50)
set @sorting = N' order by pzInsKey ASC '
TO:
set @sorting = N' order by pyMinimumDateTimeForProcessing ASC ‘
- Implement Software Fix HFIX-21858
This corrects the problem of the invalid/missing TABLE_NAME parameter in the call to the stored procedure.
Published March 23, 2016 - Updated October 8, 2020
Have a question? Get answers now.
Visit the Collaboration Center to ask questions, engage in discussions, share ideas, and help others.