New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Optimize(Search): use LEFT JOIN filter on SELECT statement for Consumable #17078
Optimize(Search): use LEFT JOIN filter on SELECT statement for Consumable #17078
Conversation
I haven't had time to test it, but could this be done with the undocumented This parameter is used at least in the Contract class. |
good point, let me check if it works |
You're right, using |
The latest commit prohibits the use of search options in meta search Without this, the TU tries to use them (and gives an error) even though they are not available (natively) in the interface. |
Could you please rebase this one? I cannot merge it right now, no idea why. |
236c8b4
to
b5871c0
Compare
done =) |
From the list of
Consumable
, using the following search filters together causes data to load slowlyNumber of new consumables
Number of used consumables
This simple
SQL
statementTakes almost 1 min 11,978 sec to return the results (42 rows)
Here is an
EXPLAIN
of thisSQL
queryNumber of new consumables
->42 rows in set (0,037 sec)
Number of used consumables
->42 rows in set (0,058 sec)
The double left join on the glpi_consumables table seems to be the cause
But as this is not my area of expertise, I can't say why
glpi_consumables
-> 39652,glpi_consumableitems
-> 63 )To try and optimise this SQL query, I decided to deport the filter included in the
LEFT JOIN
directly into theSELECT
statementThis optimized SQL query takes almost 0,041 sec to return the results (42 rows) 👍
Here is an
EXPLAIN
of this optimizedSQL
querynote that this PR -> #16999
did not solve this problem (which must be different)