Author Topic: PROBLEM: Slow query to verify orphaned files > 60 seconds and solution  (Read 1041 times)

Studio 42

  • Contributing Developer
  • Sr. Member
  • *
  • Posts: 4608
  • Joomla & Virtuemart developper
    • Studio 42 - Virtuemart & Joomla extentions
  • VirtueMart Version: 2.6 & 3

The key is missing in category_media and manufacturer_media table even in last release candidate
  KEY `virtuemart_media_id` (`virtuemart_media_id`),
So if you check for orphan files the query need more then 60 secondes for 1500 images in categories
I added directly this key and now the query need never more then 1 seconde.
Now checking for orphan medias is 100 X faster !

Studio 42

  • Contributing Developer
  • Sr. Member
  • *
  • Posts: 4608
  • Joomla & Virtuemart developper
    • Studio 42 - Virtuemart & Joomla extentions
  • VirtueMart Version: 2.6 & 3
Re: PROBLEM: Slow query to verify orphaned files > 60 seconds and solution
« Reply #1 on: December 07, 2021, 20:59:45 pm »
Damn bug on editing a post.
Again :
The key is missing in category_media and manufacturer_media table even in last release candidate
  KEY `virtuemart_media_id` (`virtuemart_media_id`),
So if you check for orphan files the query need more then 60 secondes for 1500 images in categories
I added directly this key and now the query need never more then 1 seconde.
Now checking for orphan medias is 100 X faster !