Openbravo Issue Tracking System - Openbravo ERP |
View Issue Details |
|
ID | Project | Category | View Status | Date Submitted | Last Update |
0025466 | Openbravo ERP | A. Platform | public | 2014-01-13 11:47 | 2014-02-12 18:29 |
|
Reporter | jecharri | |
Assigned To | alostale | |
Priority | urgent | Severity | major | Reproducibility | always |
Status | closed | Resolution | fixed | |
Platform | | OS | 5 | OS Version | |
Product Version | pi | |
Target Version | 3.0PR14Q2 | Fixed in Version | 3.0PR14Q2 | |
Merge Request Status | |
Review Assigned To | shankarb |
OBNetwork customer | |
Web browser | Google Chrome |
Modules | Core |
Support ticket | |
Regression level | |
Regression date | |
Regression introduced in release | |
Regression introduced by commit | |
Triggers an Emergency Pack | No |
|
Summary | 0025466: Performace problem during the login |
Description | Performace problem during the login
Due to solve issue https://issues.openbravo.com/view.php?id=24962 [^] now we are having this issue. The problem is that now the query:
StringBuilder hql = new StringBuilder();
hql.append("select count(*)");
hql.append(" from ADSession s ");
hql.append(" where s.loginStatus='F'");
hql.append(" and s.username = :name");
hql.append(" and s.creationDate > (select coalesce(max(s1.creationDate), s.creationDate-1)");
hql.append(" from ADSession s1");
hql.append(" where s1.username = s.username");
hql.append(" and s1.loginStatus!='F')");
Query q = OBDal.getInstance().getSession().createQuery(hql.toString());
q.setParameter("name", userName);
is executed in file "src/org/openbravo/base/secureApp/UserLock.java" and that query has bad performance |
Steps To Reproduce | -confiure parameter "login.trial.user.lock"
Verify that it takes a long time to login for example if your table ad_session is big (200MB) |
Proposed Solution | |
Additional Information | |
Tags | Performance |
Relationships | related to | defect | 0038651 | | closed | alostale | problems in user locking implementation | related to | defect | 0044414 | | new | Triage Platform Base | UserLock feature (delay login on wrong login) has bad performance by default |
|
Attached Files | |
|
Issue History |
Date Modified | Username | Field | Change |
2014-01-13 11:47 | jecharri | New Issue | |
2014-01-13 11:47 | jecharri | Assigned To | => AugustoMauch |
2014-01-13 11:47 | jecharri | Web browser | => Google Chrome |
2014-01-13 11:47 | jecharri | Modules | => Core |
2014-01-13 11:47 | jecharri | Resolution time | => 1392764400 |
2014-01-13 11:47 | jecharri | Triggers an Emergency Pack | => No |
2014-01-14 13:34 | alostale | Tag Attached: Performance | |
2014-01-15 09:01 | shuehner | Issue Monitored: shuehner | |
2014-01-27 15:30 | alostale | Note Added: 0063718 | |
2014-01-27 15:30 | alostale | Assigned To | AugustoMauch => alostale |
2014-01-27 15:32 | hgbot | Checkin | |
2014-01-27 15:32 | hgbot | Note Added: 0063719 | |
2014-01-27 15:32 | hgbot | Status | new => resolved |
2014-01-27 15:32 | hgbot | Resolution | open => fixed |
2014-01-27 15:32 | hgbot | Fixed in SCM revision | => http://code.openbravo.com/erp/devel/pi/rev/496cbeb8f989ceabb54b9d0e00c3400dfb2e61d8 [^] |
2014-01-27 15:33 | alostale | Review Assigned To | => shankarb |
2014-01-28 06:45 | shankarb | Note Added: 0063731 | |
2014-01-28 06:45 | shankarb | Status | resolved => closed |
2014-01-28 06:45 | shankarb | Fixed in Version | => 3.0MP32 |
2014-01-28 11:57 | jecharri | Note Added: 0063745 | |
2014-01-28 11:57 | jecharri | Status | closed => new |
2014-01-28 11:57 | jecharri | Resolution | fixed => open |
2014-01-28 11:57 | jecharri | Fixed in Version | 3.0MP32 => |
2014-01-29 11:06 | hgbot | Checkin | |
2014-01-29 11:06 | hgbot | Note Added: 0063776 | |
2014-01-29 11:06 | hgbot | Status | new => resolved |
2014-01-29 11:06 | hgbot | Resolution | open => fixed |
2014-01-29 11:06 | hgbot | Fixed in SCM revision | http://code.openbravo.com/erp/devel/pi/rev/496cbeb8f989ceabb54b9d0e00c3400dfb2e61d8 [^] => http://code.openbravo.com/erp/devel/pi/rev/b424cda58024897df64fdf1ba1512444bb741038 [^] |
2014-01-29 11:09 | alostale | Note Added: 0063778 | |
2014-02-04 22:39 | jecharri | Note Added: 0063905 | |
2014-02-12 04:23 | shankarb | Note Added: 0064070 | |
2014-02-12 04:23 | shankarb | Status | resolved => closed |
2014-02-12 04:23 | shankarb | Fixed in Version | => 3.0MP32 |
2014-02-12 18:29 | hudsonbot | Checkin | |
2014-02-12 18:29 | hudsonbot | Note Added: 0064119 | |
2014-02-12 18:29 | hudsonbot | Checkin | |
2014-02-12 18:29 | hudsonbot | Note Added: 0064133 | |
2018-05-29 16:18 | alostale | Relationship added | related to 0038651 |
2020-06-18 17:00 | shuehner | Relationship added | related to 0044414 |
Notes |
|
|
Tested in a PG DB with 590K entries in AD_Session.
Time is reduced from ~75s to 320ms. |
|
|
(0063719)
|
hgbot
|
2014-01-27 15:32
|
|
Repository: erp/devel/pi
Changeset: 496cbeb8f989ceabb54b9d0e00c3400dfb2e61d8
Author: Asier Lostalé <asier.lostale <at> openbravo.com>
Date: Mon Jan 27 15:32:04 2014 +0100
URL: http://code.openbravo.com/erp/devel/pi/rev/496cbeb8f989ceabb54b9d0e00c3400dfb2e61d8 [^]
fixed bug 25466: login performance when checking user lock
username is not joined but passed as parameter, in this way query is
executed in a more efficient manner
---
M src/org/openbravo/base/secureApp/UserLock.java
---
|
|
|
(0063731)
|
shankarb
|
2014-01-28 06:45
|
|
Code reviewed and verified in pi changeset 9b47b9cdf8c1. |
|
|
|
The solution does not work in oracle. The query is still slow |
|
|
(0063776)
|
hgbot
|
2014-01-29 11:06
|
|
Repository: erp/devel/pi
Changeset: b424cda58024897df64fdf1ba1512444bb741038
Author: Asier Lostalé <asier.lostale <at> openbravo.com>
Date: Wed Jan 29 11:05:39 2014 +0100
URL: http://code.openbravo.com/erp/devel/pi/rev/b424cda58024897df64fdf1ba1512444bb741038 [^]
fixed bug 25466: login performance when checking user lock
splitting query with subquery into 2 different ones which perform better
---
M src/org/openbravo/base/secureApp/UserLock.java
---
|
|
|
|
After latest fix tested in:
-PG with 590K entries in AD_Session.
-ORA with 265K entries in AD_Session.
Improvements:
-PG remains almost the same as with previous fix: from 75s to 300ms
-ORA: from 85s to 100ms |
|
|
|
For me the results are not as good as Asier had:
-before the patch 3 seconds
-after that 860ms x 2 = 1.720 seconds |
|
|
(0064070)
|
shankarb
|
2014-02-12 04:23
|
|
Code reviewed and verified in pi changeset d704451d1d2e. |
|
|
|
|
|
|
|