- Posts: 82
- Thank you received: 1
Very slow query execution
11 years 11 months ago #177086
by jmbgreen
Very slow query execution was created by jmbgreen
-- HikaShop version -- : business 2..4
-- Joomla version -- : 3.3.6
-- PHP version -- : 5.3+ / 5.4
Hello,
I am in the middle of a migration process from J2.5 to J3.
I had my dev version almost completed and wanted to transfer the latest data from the live website.
I updated hika to the latest release on J2.5 and then export - import the tables to the new J3.
But now any Hika category product pages are loading too slow (about 1 minute to load).
There is particularly one query (the one that counts the published items of the current category) that takes up to 1 minute to execute :
In my MySQL admin tool, I run the query in both the database (j2.5 and J3) and at the first occasion it takes a few miliseconds to execute when on the second ~55 seconds.
What can be the case here ?
-- Joomla version -- : 3.3.6
-- PHP version -- : 5.3+ / 5.4
Hello,
I am in the middle of a migration process from J2.5 to J3.
I had my dev version almost completed and wanted to transfer the latest data from the live website.
I updated hika to the latest release on J2.5 and then export - import the tables to the new J3.
But now any Hika category product pages are loading too slow (about 1 minute to load).
There is particularly one query (the one that counts the published items of the current category) that takes up to 1 minute to execute :
Code:
SELECT count( DISTINCT b.product_id)
FROM zi2e5_hikashop_product_category AS a
LEFT JOIN zi2e5_hikashop_product AS b
ON a.product_id=b.product_id
WHERE b.product_published=1
AND b.product_type = 'main'
AND a.category_id IN (12)
AND (b.product_access = 'all' OR b.product_access LIKE '%,15,%')
ORDER BY a.ordering ASC
In my MySQL admin tool, I run the query in both the database (j2.5 and J3) and at the first occasion it takes a few miliseconds to execute when on the second ~55 seconds.
What can be the case here ?
Please Log in or Create an account to join the conversation.
11 years 11 months ago #177089
by jmbgreen
Replied by jmbgreen on topic Very slow query execution
I guess that this was something related with the tables optimization. The MySQL tool, was unable to display the exact total number of the records. Whatever I did try to re-create the table's index didn't give me the desired results.
Finally I deleted the tables and re-imported them.
Now the query executes fine.
Finally I deleted the tables and re-imported them.
Now the query executes fine.
Please Log in or Create an account to join the conversation.
11 years 11 months ago #177098
by Jerome
Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.
Replied by Jerome on topic Very slow query execution
Hi,
Thanks for the tip.
Regards,
Thanks for the tip.
Regards,
Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.
Please Log in or Create an account to join the conversation.
Time to create page: 0.153 seconds