Skip to main content

This content has been archived and is no longer being updated. Links may not function; however, this content may be relevant to outdated versions of the product.

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

Was this useful?

0% found this useful

Have a question? Get answers now.

Visit the Collaboration Center to ask questions, engage in discussions, share ideas, and help others.

Did you find this content helpful?

Want to help us improve this content?

We'd prefer it if you saw us at our best.

Pega Community has detected you are using a browser which may prevent you from experiencing the site as intended. To improve your experience, please update your browser.

Close Deprecation Notice
Contact us