View source | View content page | Page history | Printable version   
Toolbox
Main Page
Upload file
What links here
Recent changes
Help

PDF Books
Show collection (0 pages)
Collections help

Search

Projects:Performance Optimization/Specifications

Contents

Overview

Performance Optimization is a project focused on fixing multiple issues in many different places of the application.

Detected Issues

Data Grid

Retrieves all data

Data Grid retrieves all data for the table (with the applied filter) not only the displayed rows.

Fetched unnecessary columns

The dynamically created query for the grid is fetching all the columns in the table while it is not necessary and makes the query to be slower.

Many requests to backend

Many requests to the backend are sent from the datagrid.js that are worthless, so performance is damaged.

Others

WAD

Remove unnecessary imports in generated sources

WAD generated sources contain non-used importations.

XMLEngine

Remove unused XMLEngine templates

In XMLEngine there are some templates that are no longer used.

SQL Issues

AD_Column_Identifier function

AD_Column_Identifier function is used to display the identifier of a record, when it is included in a bigger query (for example in infos) it makes the query to be slow.

Current model

Currently SQL query to get identifier is stored in AD_Table. AD_Update_Column_Identifier procedure, which is invoked by wad, updates this SQL statement. AD_Column_Identifier function executes this query to get the identifier for a single record.

The current clause looks like:

SELECT identifier_columns AS COLUMN_IDENTIFIER 
  FROM (SELECT AD_LANGUAGE 
          FROM AD_LANGUAGE 
         WHERE AD_LANGUAGE=:c_language) L, 
        yourTable T 
  WHERE yourTable_ID=:c_ID

SELECT (SELECT COALESCE(TO_CHAR(MAX(TT.Name)), TO_CHAR(T.Name)) 
          FROM yourTable_Trl TT 
         WHERE TT.yourTable_ID=T.yourTable_ID 
           AND TT.AD_LANGUAGE=L.AD_LANGUAGE)  AS COLUMN_IDENTIFIER 
  FROM (SELECT AD_LANGUAGE 
          FROM AD_LANGUAGE 
         WHERE AD_LANGUAGE=:c_language) L, 
        yourTable T 
  WHERE yourTable_ID=:c_ID

The first one is for tables without language translation and the second one for table with it.

In both cases it is not necessary the AD_Language subquery (for translated tables it would be enough passing the :c_language parameter to the first subquery).

Other approaches
Maintain a glossary table

This table would contain the identifier for every record in database.

Pros
Cons

Java Issues

Garbage Collector thread

Application calls a thread that invokes garbage collector, this was done for old Tomcat version but currently it has non-sense.

Key Map class

When KeyMap class is instanced it is created a complete structure for the tab (including all its columns, primary key, etc.), this structure is never used, in fact just tab and window names are actually used.

Code style

Currently there is inefficient control structures and data types used. The following list is things to avoid and suggestions:

Javascript Issues

Js Importations

Many pages are importing javascript files that are not used.

Compilation Issues

sqlc

When xsql files are compiled by sqlc SQL clauses are tested in db, depending on the amount of data in db it can be very slow.

Number of compilation tasks

Reduce the number of compilation tasks and improve them to make them more 'intelligent', this is, compile just the necessary things.

Other Issues

Order Product callout

SLOrderProduct takes very long in installations with a big number of orders. The problem is the usage of the lastPriceSO column where is calculated the last price used. This column should be deprecated and the calculation removed from the callout.

Database Issues

Selects use functional conditions without corresponding indexes

In many SELECT statement the WHERE condition uses for example UPPER(columnname)=UPPER(value), but there is no corresponding index. This cases the database to select sequence scan instead of index scan.

When this kind of WHERE condition is needed often it may be good to add corresponding functional index.

Retrieved from "http://wiki.openbravo.com/wiki/Projects:Performance_Optimization/Specifications"

This page has been accessed 3,939 times. This page was last modified on 8 June 2012, at 05:29. Content is available under Creative Commons Attribution-ShareAlike 2.5 Spain License.