Project:
View Revisions: Issue #28479 | [ Back to Issue ] | ||
Summary | 0028479: unneeded queries to ad_langue table | ||
Revision | 2017-10-13 12:13 by alostale | ||
Description | Whenever a new DAL object instance of any entity that has a reference to AD_Language is created, a query to AD_Language table is executed. This is caused because: 1. Hibernate eagerly initializes many-to-one references that are linked not by primary key but by unique constraint. 2. After this eager initialization the object is not included in 1st level cache. This is noticeable, for example, when standard views are generated in an instance with translations installed, ad_langue table is unnecessarily queried. The problem is caused while initializing proxies for trl lists (ie. fld.getADFieldTrlList()). Translation relationship is based not on FK but on unique constraint, due to some issue in Hibernate these relationships are not proxied nor cached, resulting on being queried whenever the object is initialized. In a customer with translations installed, it's been measured queries to AD_Language to be ~ 8% of the total number of executed queries. |
||
Revision | 2017-10-13 12:13 by alostale | ||
Steps To Reproduce | 1. Install Spanish translation 2. Set all modules in development so view is always computed 3. Set pg to log all queries 4. Open BP window -> Check there are 8500 queries to ad_language (all of them retrieving the same record) |
||
Revision | 2017-10-13 12:13 by alostale | ||
Description | Whenever a new DAL object instance of any entity that has a reference to AD_Language is created, a query to AD_Language table is executed. This is caused because: 1. Hibernate eagerly initializes many-to-one references that are linked not by primary key but by unique constraint. 2. After this eager initialization the object is not included in 1st level cache. This is noticeable, for example, when standard views are generated in an instance with translations installed, ad_langue table is unnecessarily queried. The problem is caused while initializing proxies for trl lists (ie. fld.getADFieldTrlList()). Translation relationship is based not on FK but on unique constraint, due to some issue in Hibernate these relationships are not proxied nor cached, resulting on being queried whenever the object is initialized. In a customer with translations installed, it's been measured queries to AD_Language to be 0000061:0000008% of the total number of executed queries. |
||
Revision | 2017-10-13 12:02 by alostale | ||
Steps To Reproduce | -Install Spanish translation -Set pg to log all queries -Open BP window -Check there are 8500 queries to ad_language (all of them retrieving the same record) |
||
Revision | 2017-10-13 12:02 by alostale | ||
Description | When standard views are generated in an instance with translations installed, ad_langue table is unnecessarily queried. The problem is caused while initializing proxies for trl lists (ie. fld.getADFieldTrlList()). Translation relationship is based not on FK but on unique constraint, due to some issue in Hibernate these relationships are not proxied nor cached, resulting on being queried whenever the object is initialized. |
Copyright © 2000 - 2009 MantisBT Group |