Uploaded image for project: 'eZ Publish / Platform'
  1. eZ Publish / Platform
  2. EZP-22913

Removing version image aliases causes MySQL timeouts due to extremely high amount of queries.

    XMLWordPrintable

    Details

    • Sprint:
      Castor Core S2

      Description

      For content objects with multiple image attributes, multiple translations, and multiple versions,
      each time a version is removed it will perform a very large ammount of queries related to removal of image aliases.

      Sample case:
      An object with 20 image attributes, in 20 translations will have 400 image attributes per version, 8000 total.

      When removing an object version, the image attributes will be removed, which will cause the imagealiashandler to remove
      the aliases.
      For each attribute, for each alias, it will query every single of the existing aliases (8000) in order to re-add it to the table if necessary.

      This causes many thousands of queries for each version, which will in turn cause a timeout, for example, when publishing new content.

      For reference, the eZImageFile::appendFilepath() function seems responsible for 90%+ of the queries/time to remove an object version.

      Steps to reproduce:
      • Setup 10 languages
      • Create a class with 5 image attributes, untranslatable.
      • Create a new object of that class in default language, upload image files
      • Now add a new version for each language, based on the default 'eng-GB'
        ( activating debug redirection is recommended )
      • create a copy of the object.
      • on the copied object, start to edit a new version

      Result:
      As the new version (11) will go above the default version history limit, old versions will be removed, and a large number of sql queries will be generated

        Attachments

        1. ez_sql_debug_output.rar
          801 kB
        2. ezimagealiashandler.php.rej
          3 kB
        3. ezimagealiashandler.php.rej
          17 kB
        4. ezimagealiashandler.php.rej.47
          9 kB
        5. ezp-22913-4.7_custom.patch
          15 kB
        6. ezp-22913-5.0_custom.patch
          15 kB
        7. ezp-22913-5.0_custom-v2.patch
          13 kB

          Issue Links

            Activity

              People

              Assignee:
              Unassigned
              Reporter:
              joao.inacio-obsolete@ez.no Joao Inacio (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              10 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 3 days, 5 hours, 25 minutes
                  3d 5h 25m