Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0004155Openbravo ERPB. User interfacepublic2008-06-24 17:042008-10-08 18:41
user71 
gorka_gil 
urgentminoralways
closedfixed 
5
 
2.35MP7 
OBPS
Core
No
0004155: 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.

OBN
blocks defect 0002077 closed alostale Grid view results in very large number of db queries 
Issue History
2008-06-24 17:04cromeroNew Issue
2008-06-24 17:04cromeroAssigned To => alostale
2008-06-24 17:04cromeroStatusnew => scheduled
2008-06-24 17:04cromeroTag Attached: OBN
2008-06-24 17:04cromeroOBNetwork customer => Yes
2008-06-24 17:04cromeroPrioritynormal => urgent
2008-06-24 17:04cromeroDescription Updated
2008-06-24 18:04cromeroStatusscheduled => feedback
2008-06-27 12:22cromeroStatusfeedback => scheduled
2008-06-27 12:22cromeroAssigned Toalostale => gorka_gil
2008-06-30 11:47svnbotCheckin
2008-06-30 11:47svnbotNote Added: 0008060
2008-06-30 11:47svnbotStatusscheduled => resolved
2008-06-30 11:47svnbotResolutionopen => fixed
2008-06-30 11:47svnbotsvn_revision => 5477
2008-10-08 18:41psarobeRegression testing => No
2008-10-08 18:41psarobeStatusresolved => closed
2008-10-08 18:41psarobeNote Added: 0009458

Notes
(0008060)
svnbot   
2008-06-30 11:47   
Repository: openbravo
Revision: 5477
Author: gorka_gil
Date: 2008-06-30 11:47:53 +0200 (Mon, 30 Jun 2008)

fixed bug 4155 Grid view results in very large number of db queries

---
U branches/r2.3x/src/org/openbravo/erpCommon/utility/TableSQLData.java
U branches/r2.3x/src/org/openbravo/erpCommon/utility/TableSQLQuery_data.xsql
---

https://dev.openbravo.com/websvn/openbravo/?rev=5477&sc=1 [^]
(0009458)
psarobe   
2008-10-08 18:41   
Impossible to test with that information. Talking with GGI, he cannot tell what to test to ensure it is fixed. Just code review