Author Topic: Bad price index for product price table  (Read 751 times)

Studio 42

  • Contributing Developer
  • Sr. Member
  • *
  • Posts: 4522
  • Joomla & Virtuemart developper
    • Studio 42 - Virtuemart & Joomla extentions
  • VirtueMart Version: 2.6 & 3
Bad price index for product price table
« on: July 30, 2015, 22:17:35 pm »
Hi,
I'm on speedup a customer site. I checked to add the index for product_price and was wondered this exist.
On looking details i have seeen this is in error. the index product_price used virtuemart_product_id column.
I changed the index to use product_price , this give a speed boost of 20% for page render when you have many products and order by product price.
TO change index
Code: [Select]
ALTER TABLE `#__virtuemart_product_prices` DROP INDEX  product_priceif index do not exist simply :
Code: [Select]
ALTER TABLE `#__virtuemart_product_prices` ADD INDEX product_price (product_price)If you use mysql do not forget to change table prefix

I checked in last VM 3.0.9.4, the index is bad too.