Improve number of queries to DB
Hi.
I am using GLPI 9.4.3 and GLPI 9.4.4. I have noticed that performance has declined and I think I know why.
In a fresh installation GLPI needs 66 queries to DB to show the tickets list window (without tickets).
For do that, it need to open 3 sessions to DB.
GLPI_9_4_4_ticket_list_fresh_installation.log
When 1 ticket is load, GLPI needs 76 queries to DB to show the ticket list window (with 1 ticket).
Again, for do that, it need to open 3 sessions to DB.
GLPI_9_4_4_ticket_list_1_ticket.log
When 2 tickets are load, GLPI needs 84 queries to DB to show the ticket list window (with 2 ticket) and open 3 sessions.
This behaviour produce that when the tickets number increase, the number of queries to DB increase too.
In addition, some queries are repetead several times.
For example, the queries to load users' data are repeated for every time that the user have to be showed in the tickets list (like requester, observer or technician).
Maybe you can save user information in an array on the first search and check there every time the user must be showed more than once.
I think that is important reduce the number of queries because in a production environment, to display a list with 15 tickets, GLPI needs to make about 900 queries to the database.
glpi_mysql_without_genericobject.log
And finally, having the genericobject plugin activated with 80 types of objects approximately, GLPI needs to do almost 11200 queries to the bd to show a list with 15 tickets. In this case, some queries are repeated more than 1000 times.
glpi_mysql_with_genericobject.log
I await your comments.
Best regards.
Emanuel
Сервис поддержки клиентов работает на платформе UserEcho