Very slow query execution

  • Posts: 82
  • Thank you received: 1
10 years 9 months ago #177086

-- 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 :

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.

  • Posts: 82
  • Thank you received: 1
10 years 9 months ago #177089

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.

Please Log in or Create an account to join the conversation.

  • Posts: 26264
  • Thank you received: 4043
  • MODERATOR
10 years 9 months ago #177098

Hi,

Thanks for the tip.

Regards,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.

Please Log in or Create an account to join the conversation.

Time to create page: 0.053 seconds
Powered by Kunena Forum