Removing an image object (or just an archived version) calls this query in eZImage::fetchImageAttributesByFilepath():
with a large database, including multiple languages and versions for many images, the number of rows scanned becomes really large.
1 - table lacks an index for (contentobject_id, contentclassattribute_id)
2 - the LIKE clause is looking for a match in the middle of data_text, which holds an xml data string. searches with wildcards at both ends are known to be performance killers
- create a structure of about 100 images in one folder
- edit some of the images to include 3 versions each
- remove a version, check the query used.
- manually check in sql the rows scanned with EXPLAIN EXTENDED
- insert an index for (contentobject_id, contentclassattribute_id)
- run EXPLAIN EXTENDED the same query