- Posts: 303
- Thank you received: 18
Dashboard Slow Loading
- mojooutdoors-holden
-
Topic Author
- Offline
-- Joomla version -- : 3.8.6
For a while now, our dashboard takes an abnormal amount of time to load -- sometimes more than 20 seconds. Is there a particular database table that might be slowing it down? Large order or email log table? I've been trying to locate a fix but haven't had much luck.
The dashboard is the only page to load slowly. The rest of the backend has minimal loading times.
Please Log in or Create an account to join the conversation.
Turn on the "debug mode" setting of the Joomla configuration and look at the bottom of the dashboard page.
You'll get all the queries on the page with the timings for each one.
That way, you can see which query is slow and then deduce from that which table is too big and / or which query could be optimized.
Please Log in or Create an account to join the conversation.
- mojooutdoors-holden
-
Topic Author
- Offline
- Posts: 303
- Thank you received: 18
However, i'm unsure how to resolve the errors. Seems to be related to the hikashop tables though. Not sure what the "NO INDEX KEY COULD BE USED" error is, but it seems that it forces the entire table to be indexed which takes a ton of time. Any ways to quickly resolve this? Surely it's a common problem?
Please Log in or Create an account to join the conversation.
For some reasons it looks like it's not able to use the index available on the file_type column of the hikashop_file table. Can you check that you have that index ?
superuser.com/questions/766451/view-exis...xes-using-phpmyadmin
It's not a common problem.
Database and mysql queries optimization is not a simple matter. It depends on how much data you have in each table of the Mysql query, how the query is constructed and how the tables are made to store the data.
A query might be optimized for a specific case which might end up bein detrimental to another case.
Can you check whether you have the "dashboard legacy" setting activated or not ?
Changing that setting could well help circumvent the problem.
Please Log in or Create an account to join the conversation.
- mojooutdoors-holden
-
Topic Author
- Offline
- Posts: 303
- Thank you received: 18
Please Log in or Create an account to join the conversation.
The legacy checkout option won't change anything regarding the dashboard. I was talking about the "dashboard legacy" setting. Please check the correct setting.
Regarding the table structure, just below the area of your screenshot, you must have an "index" link you can click on and it will then expand to display the indexes on that table:
monosnap.com/file/PVtqs7dhl3Yu0gqw5b4V54kEbu8VGc
Please Log in or Create an account to join the conversation.
- mojooutdoors-holden
-
Topic Author
- Offline
- Posts: 303
- Thank you received: 18
Please Log in or Create an account to join the conversation.
Regarding the query details, it looks like the "order product" table is right now the element to optimize.
It might be interesting to add an index on the "product_id" to speed up some queries ; you have a very high number of entries in that table in your side.
The "generic" query to add the index is :
Please let us know if it improve the query and you can give us a new screenshot of the debug so we can compare values.
Regards,
Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.
Please Log in or Create an account to join the conversation.
- mojooutdoors-holden
-
Topic Author
- Offline
- Posts: 303
- Thank you received: 18
As far as the database results, the key was successfully added in the jml_hikashop_order_product table
Any other suggestions? I can give database access and super user access to the backend of the website if necessary.
Please Log in or Create an account to join the conversation.
- mojooutdoors-holden
-
Topic Author
- Offline
- Posts: 303
- Thank you received: 18
Please Log in or Create an account to join the conversation.
I don't remember in which version exactly but we added an index in the hikashop_file table ; but just in the database definition and not via the update system.
So, it could explain why you do not have the index for that.
The "generic" query to add the index is :
Afterwards, the index could be more optimized by using a combination of file_type + file_ref_id.
Regards,
Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.
Please Log in or Create an account to join the conversation.
- mojooutdoors-holden
-
Topic Author
- Offline
- Posts: 303
- Thank you received: 18
By using a combination of file_type + file_ref_id, do you mean to generate another index called file_type with:
Please Log in or Create an account to join the conversation.
Jerome meant using such query:
Please Log in or Create an account to join the conversation.
- mojooutdoors-holden
-
Topic Author
- Offline
- Posts: 303
- Thank you received: 18
Meaning if I add the query you sent Nicolas, will it mess anything up?
Please Log in or Create an account to join the conversation.
You can have multiple index in your tables (as long as the index name is unique).
But it is possible to add several time an index on the same columns, it won't bother mysql (but it will tell you that it's useless).
Regards,
Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.
Please Log in or Create an account to join the conversation.
- mojooutdoors-holden
-
Topic Author
- Offline
- Posts: 303
- Thank you received: 18
Dashboard loading time went from +10 seconds down to just 2-3 seconds.
Please Log in or Create an account to join the conversation.