-- HikaShop version -- : 2.3.3
-- Joomla version -- : 3.4.6
Hi,
I have the business version of hikashop configured to show a list of categories in the left with the product listing in the center of my page.
Everything worked fine until I started creating some products. Then it started to slow down, and it takes 43 seconds to load the page...
I traced the problem and found out that this query that takes 30 seconds to execute:
SELECT DISTINCT b.*
FROM j5yie_hikashop_product_category AS a
LEFT JOIN j5yie_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 (2)
AND b.product_quantity!=0
AND (b.product_access = 'all' OR b.product_access LIKE '%,9,%')
ORDER BY a.ordering ASC
LIMIT 0, 30
I have 63000 registers in the category table and 28000 registers in the product table. It isn't so much from my point of view.
My solution was to remove the order by clause of the query, editing the line 588 of components/com_hikashop/views/product/view.html.php (adding an "if" to only impact my specific query).
I think the ordering of the products and categories in my page is working without problems anyway. So my question is, which is the reason to have the order by clause in this query.
And, as I had to modify a core hikashop file to make it work, will any update remove my code? Is it possible to override the method like in the templates?
Regads,
Albert