Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0002077Openbravo ERPB. User interfacepublic2007-10-11 10:082008-07-02 17:31
user71 
alostale 
normalminoralways
closedfixed 
5
 
2.40beta 
No
Core
No
0002077: Grid view results in very large number of db queries

OS: Linux - Suse 10.2 (test/prod) & Windows XP (dev)
DB: Postgres 8.1.5 (test/prod) & 8.2.4 (dev)
Release: 2.34
Browser: Firefox 2.0.0.6, IE 7

Actually noticed this one in an installation on an an old server. When viewing the Purchase Order grid each datagrid ajax request would take about 5 seconds. This often caused the grid not to display the data (I assume due to an ajax timeout).

The slowness is caused by the construction of the table sql. In the Purchase order case the structure comes back quickly then when creating the sql it goes off the db again many many times.

I was able to improve it significantly by only fetching the displayed columns/fields in the initial structure query. (which then cuts down on the the number of subsequent db requests).

After applying the attached patch the request time went down to less than a second. There is still lots of room for optimization but this helps a lot.

No tags attached.
depends on backport 0004155 closed gorka_gil Grid view results in very large number of db queries 
Issue History
2008-06-24 17:03cromeroStatusclosed => new
2008-06-24 17:03cromeroResolutionfixed => open
2008-06-24 17:03cromeroFixed in Version2.40alpha-r2 =>
2008-06-24 17:04cromeroStatusnew => scheduled
2008-06-24 17:04cromeroStatusscheduled => resolved
2008-06-24 17:04cromerosvn_revision => 2261
2008-06-24 17:04cromeroResolutionopen => fixed
2008-06-24 17:56cromeroStatusresolved => new
2008-06-24 17:56cromeroResolutionfixed => open
2008-06-24 17:56cromeroStatusnew => scheduled
2008-06-24 17:57cromeroStatusscheduled => resolved
2008-06-24 17:57cromeroFixed in Version => 2.40alpha-r2
2008-06-24 17:57cromeroResolutionopen => fixed
2008-07-02 17:31plujanStatusresolved => closed
2008-07-02 17:31plujanFixed in Version2.40alpha-r2 => 2.40beta

Notes
(0005666)
user71   
2005-06-01 00:00   
(edited on: 2008-06-12 09:43)
This bug was originally reported in SourceForge bug tracker and then migrated to Mantis.

You can see the original bug report in:
https://sourceforge.net/support/tracker.php?aid=1811346 [^]
(0002345)
dbaz   
2007-11-30 19:38   
(edited on: 2008-06-12 09:22)
Logged In: YES
user_id=1500873
Originator: NO

Thanks eintel!

When I solve my 2.3x critical bugs I will test it in order to include it on the 2.40!

Thanks again!
(0002346)
villind   
2008-01-24 10:49   
(edited on: 2008-06-12 09:22)
Logged In: YES
user_id=61737
Originator: NO

Hi,

I tried to apply this to the trunk and xsql file was successful, but java file failed. If you have time to bring this patch up to date with current trunk I can try to apply it to performance branch.

Ville
(0002347)
user71   
2008-01-24 11:17   
(edited on: 2008-06-12 09:22)
Logged In: YES
user_id=1737231
Originator: YES

Ville,
I'm off for a long weekend but I will update the patch next week

Ben
(0002348)
dbaz   
2008-01-24 11:32   
(edited on: 2008-06-12 09:22)
Logged In: YES
user_id=1500873
Originator: NO

One thing:

"When
viewing the Purchase Order grid each datagrid ajax request would take about
5 seconds. This often caused the grid not to display the data (I assume
due to an ajax timeout)."

Now, in 2.35MP1 the grid has been improved and always shows data. The lack of data in some grids with a lot of data was due to a failure in the ExecuteQuery.java. This class request all the data instead of request only the required data. It have been fixed as I said.

Thanks again.
(0002349)
alostale   
2008-02-06 10:52   
(edited on: 2008-06-12 09:22)
Logged In: YES
user_id=1500722
Originator: NO

I have applied the patch (trunk rev. 2261), but only the part affecting TableSQLQuery_data.xsql and TableSQL.java. Because I want to review KeyMap class more deeply.

Thank you very much for your contribution.