PEGA0004 alert: Quantity of data received by database query exceeds limit
The PEGA0004 alert is triggered when a query to the PegaRULES database loads into memory a quantity of data (bytes) that exceeds a per-interaction threshold (
interactionByteThreshold). This alert can take the form of a warning or an error. Monitoring this database activity helps you recognize when queries are inefficiently designed or when data is being loaded indiscriminately.
The system measures the number of bytes returned at the interaction level, not at the query level. An interaction can have more than one query. The threshold is cumulative across all queries for one interaction. If one interaction has one query that returns 60 MB of data (assuming a 50 MB threshold), it triggers an alert, but if one interaction has 60 queries that each return 1 MB, then that also triggers an alert.
When a threshold is exceeded, two
interactionByteThreshold settings in the prconfig.xml file,
ErrorMB, either warn you or warn you and stop processing.
To disable this alert for a single interaction, add this first Java step to the activity:
Example message text
The number of database bytes input for this interaction has exceeded the "warning" level for Requestor HF940FD8761E5A3A67F32F892CD68954B, operator theDeveloper@pegasystems.com, Maximum bytes: 100 Actual bytes: 600
Default prconfig.xml settings
<env name="alerts/database/interactionByteThreshold/enabled" value="true" />
This setting toggles the alert on (“true”) or off (“false”).
<env name="alerts/database/interactionByteThreshold/warnMB" value="50" />
WarnMB is exceeded, the system generates an alert to the Alert log file. Processing does not stop. Use the
warntraceback setting to include stack trace information.
<env name="alerts/database/interactionByteThreshold/errorMB" value="-1" />
ErrorMB is exceeded, the query stops the service requestor, displays an error message and a stack trace in the user interface, and writes the error message and stack trace to the Alert log.
<env name="alerts/database/interactionbytethreshold/warntraceback" value="false" />
This setting displays stack trace information in the log file when the
warnMB threshold is exceeded. Set to "true" to enable the setting.
Reason for the alert
Typically, this alert occurs when you work with lists of data by way of List View, Summary View, and Obj-List rules. For example, a database query might be trying to retrieve the entire BLOB (pzPVStream).
To learn what the system was trying to process when this alert was triggered, search the Alert log by using the time stamp and the message ID number for the full text of the message, which includes a stack trace. Locate the rules that caused this much data to be read. Remediation can include one or more of the following actions (depending on your requirements):
- Modify the report so that it retrieves only information from exposed columns, and does not need the BLOB column.
- Add more criteria.
- Limit the number of rows returned or reduce the number of data columns returned.