Anonymous | Login
Project:
RSS
  
News | My View | View Issues | Roadmap | Summary

View Issue DetailsJump to Notes ] Issue History ] Print ]
ID
0043080
TypeCategorySeverityReproducibilityDate SubmittedLast Update
defect[Retail Modules] Web POSmajorhave not tried2020-01-31 11:172020-01-31 11:29
ReporterALopeteguiView Statuspublic 
Assigned ToRetail 
PriorityhighResolutionopenFixed in Version
StatusnewFix in branchFixed in SCM revision
ProjectionnoneETAnoneTarget Version
OSAnyDatabaseAnyJava version
OS VersionDatabase versionAnt version
Product VersionpiSCM revision 
Review Assigned To
Regression level
Regression date
Regression introduced in release
Regression introduced by commit
Triggers an Emergency PackNo
Summary

0043080: Performance: HQL Query validated has inefficient query to get property of preference

DescriptionIn ProcessHQLQueryValidated class there is a function to get the property of the preferences doing this query:

select property from ad_preference where property like '%EntitySelector_BPartnerFilter_bpName_s' limit 1

This query makes a sequential scan on ad_preference. This query is very frequent and makes too much read from memory/disk.

This is the explain plan
https://explain.depesz.com/s/JJny [^]
Steps To ReproduceWith more than 100K ad_preferences and heavy searching concurrency, the query could be a problem. To test it just launch a query with more than 100K preferences.

Proposed SolutionThe solution is to create a gin index in ad_preference on column property in order to find with and contains index.

CREATE INDEX <index-name> ON ad_preference USING GIN (property gin_trgm_ops);

This is the explain plan after the index:
https://explain.depesz.com/s/RS8c [^]
TagsPerformance
Attached Files

- Relationships Relation Graph ] Dependency Graph ]

-  Notes
There are no notes attached to this issue.

- Issue History
Date Modified Username Field Change
2020-01-31 11:17 ALopetegui New Issue
2020-01-31 11:17 ALopetegui Assigned To => Retail
2020-01-31 11:17 ALopetegui Triggers an Emergency Pack => No
2020-01-31 11:27 ALopetegui Tag Attached: Performance
2020-01-31 11:29 ALopetegui Priority normal => high


Copyright © 2000 - 2009 MantisBT Group
Powered by Mantis Bugtracker