Created attachment 1050513 [details] explain analyze of query and improved implementation Description of problem: the query used in get_enterable_products to generate a list of products with an active component and active version is inefficient in large Postgresql databases Version-Release number of selected component (if applicable): 4.4.9035 See attached file for explain results on postgresql
Using the query provided by Will, execution time is reduced from 55ms to 2ms on my test setup.
Tested on QA environment(bzweb01-qe) with version(4.4.9037-5, DB: mysql) QA environment(bzperfweb01.app.qa) with version(4.4.9037-5, DB: psql ) Result: Pass QE Will use regression test to cover this.
This change is now live. If there are any issues, do not reopen this bug. Instead, you should create a new bug and reference this bug.