While deleting an image all its child entries are also deleted.
Child entries types are image_locations, image_properties, image_members and image_tags
Currently, for deleting the child entries the following is done:
1. Fire a select query to fetch the child entries.
2. Enumerate through the entries and fire soft-delete (update query) on each child entry seperately.
If the number of child entries grows higher, then the amount of queries fired to delete them grows equally higher essentially increasing the response time for image delete.
This impelementation can be changed to fire one db query for all the child entries corresponding to a particular child entry type.
eg., instead of invoking model.soft_delete(), we can use model_query(CHILD_ENTRY_TYPE).filter(some_condition).soft_delete().
Fix proposed to branch: master /review. openstack. org/37214
Review: https:/