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.
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
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.
- 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
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