Calc rules queries very very slow /_virtuemart_calc_

Started by Zegenrijk, December 09, 2014, 08:58:50 AM

Previous topic - Next topic

Zegenrijk

Hello,

I have a lot of rules in 'Tax & Calc rules'....(8008 rules, different discounts in different categories). The frontend website is very very slow. So i investigated the Joomla error console and noticed that calling a virtuemart category page there are **40569 queries logged**. WOW, that's a lot!

Further investigation i noticed that this are the big ones:
**8008 × SELECT `virtuemart_country_id`
  FROM b51v3_virtuemart_calc_countries**
**8008 × SELECT `virtuemart_shoppergroup_id`
  FROM b51v3_virtuemart_calc_shoppergroups**
**8008 × SELECT `virtuemart_state_id`
  FROM b51v3_virtuemart_calc_states**
**8008 × SELECT `virtuemart_category_id`
  FROM b51v3_virtuemart_calc_categories**
**8008 × SELECT `virtuemart_manufacturer_id`
  FROM b51v3_virtuemart_calc_manufacturers**

So, without many knowledge of queries/databases i think it's not a good thing to call every rule in a table one by one in a select.  This is the main problem...

I can provide a url (not in the forum...). I'm using latest VM2 and tried VM3, same problem.

How to solve?

Regards Michel

Milbo

Interesting, yeh of course this is not an heavily optimised part, because most people have not more than 10 rules. You may write to me your login. Maybe I can find a fst solution to prevent the worst.
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/