Yesterday I got a support ticket where a site with Virtuemart, generated around ~1400 SQL queries per request. There were around 500 categories in that shop and it causes the slow loading problem.
I forgot to tell, but he used CSS Menu for VirtueMart. Then we tried it with the Accordion Menu for Virtuemart, less queries (around ~1000), but it is enough for a speedy webshop...
I know Accordion Menu for Virtuemart in and out and I know that there is only one SQL query, so there is no problem. The problem must be in Virtuemart system. The url generation for each category took a lot of query. Every time a category tried to find and Itemid, it made a query to the database. It is not good. 500 categories = 500 query, just for a menu...
I do not want to bore you, so here is the solution for this huge issue.
- Open administrator\components\com_virtuemart\classes\ps_session.php
- Find the following code
- and replace with this
- Save the file and check the result
After this modification on the previously mentioned site, it produce only 14 query, which is far better.
It is tested on Joomla 1.5 and Virtuemart 1.1.6. Please try it on other environments and tell me if it is working or not in your configuration.
It's great information. Thanks for posting.