Skip to content

Fixes ISSUE-52072: Removes part of the combotabledata query that is not needed and slows down query

This MR has been closed because a different approach will be taken to address this issue. Trying to improve the query at ComboTableData level is too risky as there are many other columns that use it to fetch data. We will instead change the reference of the affected column.

Try run: https://builds.openbravo.com/job/try-init/2216/console

Fixes ISSUE-52072: Removes part of the combotabledata query that is not needed and slows down query

There was a performance problem in the query that is executed when retrieving data for ComboTableData, in particular when the referenced used by the field is a Table.

When generating the query, UITable adds this to the where clase (here: https://gitlab.com/openbravo/product/openbravo/-/blob/master/src/org/openbravo/reference/ui/UITable.java#L86) -> AND (td0.isActive = 'Y' OR td0.C_Order_ID = (?) ) // this is an example for the c_order table

That clause is add to try to get the identifier of a combo by retrieving the selected value (the parameter), and if the parameter is found any active record will be returned.

If the field is read only, then there is no point in trying to populate the combo table data with active values other than the current value, so the previous where clause can be replaced with: -> AND td0.C_Order_ID = (?)

Edited by Augusto Mauch

Merge request reports