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

Long-running inbound request SQL on FACTTABLE (30K open cursors)



In Oracle, one type of SQL running against Interaction History of Pega Marketing, is causing performance issues in the production environment.

The long running query is captured in the alert logs and in Oracle monitoring dashboards.

Error Messages

Database operation took more than the threshold of 500 ms: 618 ms SQL: SELECT pxFactID AS "pxFactID", pxOutcomeTime AS "pxOutcomeTime", pySubjectID AS "pySubjectID", pxIn
teractionID AS "pxInteractionID", "FACTTABLE".pzActionID AS "pzActionID", "FACTTABLE".pzChannelID AS "pzChannelID", "FACTTABLE".pzOutcomeID AS "pzOutcomeID", "pyAssociationStrength" AS
"pyAssociationStrength", "pyAssociatedID" AS "pyAssociatedID" FROM (SELECT "FACTTABLE".pxFactID, "FACTTABLE".pxOutcomeTime, "FACTTABLE".pySubjectID, "FACTTABLE".pxInteractionID, "FAC
TTABLE".pzActionID, "FACTTABLE".pzChannelID, "FACTTABLE".pzOutcomeID, null AS "pyAssociationStrength", null AS "pyAssociatedID" FROM PEGA_DATA.PR_DATA_IH_FACT "FACTTABLE" WHERE ("FACT
TABLE".pySubjectID IN ('905394590294')) UNION ALL SELECT "FACTTABLE".pxFactID, "FACTTABLE".pxOutcomeTime, "FACTTABLE".pySubjectID, "FACTTABLE".pxInteractionID, "FACTTABLE".pzActionID,
"FACTTABLE".pzChannelID, "FACTTABLE".pzOutcomeID, "ASSOCIATIONTABLE".pyAssociationStrength AS "pyAssociationStrength", "ASSOCIATIONTABLE".pySubjectID AS "pyAssociatedID" FROM PEGA_DAT
pxOutcomeTime >= ?) AND ( ( ("CHANNELTABLE".pyDirection = 'Outbound') ) ) ORDER BY 2 DESC*

Steps to Reproduce

Any time strategy is called, import IH component to the strategy canvas and test your strategy with a subjectID.

When you trace it, observe that generated SQL has the same behavior.

Root Cause

A defect in Pegasystems’ code or rules.

The issue is with SQL which is, select statement is generated by Pega.

WHERE ( "FACTTABLE".pysubjectid IN ( '905303307460' ) )

Here, pysubjectid is not a variable. It's hardcoded in this SQL and not bind variable.

Thus, Oracle treats this select statement as a new one since in each strategy execution there is a different customerId (pySubjectId).


An enhancement request, FDBK-24561, has been created for consideration by Pega Product Management.
It has been requested to improve the SQL query.

Published February 5, 2018 - Updated October 8, 2020

Was this useful?

100% 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