Anonymous | Login
News | My View | View Issues | Roadmap | Summary

View Issue DetailsJump to Notes ] Issue History ] Print ]
TypeCategorySeverityReproducibilityDate SubmittedLast Update
defect[Openbravo ERP] A. Platformminorhave not tried2013-10-30 18:502013-11-01 01:07
ReportershuehnerView Statuspublic 
Assigned Toshuehner 
PrioritynormalResolutionfixedFixed in Version3.0MP29
StatusclosedFix in branchFixed in SCM revision4a43e052de88
ProjectionnoneETAnoneTarget Version3.0MP29
OSAnyDatabaseAnyJava version
OS VersionDatabase versionAnt version
Product VersionSCM revision 
Review Assigned Toalostale
Web browser
Regression level
Regression date
Regression introduced in release
Regression introduced by commit
Triggers an Emergency PackNo

0025051: AlertBackgroundProcess is very slow when having to reprocess many alerts already present in ad_alert

DescriptionThe alert background process does first check for alerts which are outcome of a alertrule (i.e. 15k). Then in a loop for every of those it checks if they have been already inserted into ad_alert and only if not it started processing them (insert + maybe mail).

When a alertrule results in a high number of records i.e. 15k then this fires 15k small queries to check for ad_alert.

Pushing that check directly into the initial query using a (not exists) removes the need for so many small extra queries and also avoids to load the 15k alerts at all into memory.
Steps To ReproduceTake a alertrule and make it create a high number of alerts (i.e. 15k). Example is create 15k ad_process_run entries in status 'ERR'.
Check process monitor runtime for the alertbackground process and see it takes very long.
Debugging timing shows not the initial query to take so long but instead the small utility queries.
Proposed SolutionPush down the check against ad_alert into the initial query.
Attached Files

- Relationships Relation Graph ] Dependency Graph ]

-  Notes
hgbot (developer)
2013-10-30 23:54

Repository: erp/devel/pi
Changeset: 4a43e052de886824a29774277c86040a2b14f6f1
Author: Stefan Hühner <stefan.huehner <at>>
Date: Wed Oct 30 18:52:53 2013 +0100
URL: [^]

Fixed 25051: Improve alertbackground process with high number of alerts.
Improve performance of that process when it need to process a high number
of alerts created by an alertrule.
Push down the check if that alert has already been inserted into ad_alert
into the query getting the alerts instead of doing many small queries.

M src/org/openbravo/erpCommon/ad_process/
M src/org/openbravo/erpCommon/ad_process/AlertProcess_data.xsql
alostale (developer)
2013-10-31 12:55

Code reviewed + verified
hudsonbot (developer)
2013-11-01 01:07

A changeset related to this issue has been promoted main and to the
Central Repository, after passing a series of tests.

Promotion changeset: [^]

Maturity status: Test

- Issue History
Date Modified Username Field Change
2013-10-30 18:50 shuehner New Issue
2013-10-30 18:50 shuehner Assigned To => shuehner
2013-10-30 18:50 shuehner Modules => Core
2013-10-30 18:50 shuehner Triggers an Emergency Pack => No
2013-10-30 19:00 shuehner Review Assigned To => alostale
2013-10-30 23:54 hgbot Checkin
2013-10-30 23:54 hgbot Note Added: 0061990
2013-10-30 23:54 hgbot Status new => resolved
2013-10-30 23:54 hgbot Resolution open => fixed
2013-10-30 23:54 hgbot Fixed in SCM revision => [^]
2013-10-31 12:55 alostale Tag Attached: Performance
2013-10-31 12:55 alostale Note Added: 0061998
2013-10-31 12:55 alostale Status resolved => closed
2013-10-31 12:55 alostale Fixed in Version => 3.0MP29
2013-11-01 01:07 hudsonbot Checkin
2013-11-01 01:07 hudsonbot Note Added: 0062014

Copyright © 2000 - 2009 MantisBT Group
Powered by Mantis Bugtracker