list method query all image-related tags that were already deleted
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Glance |
In Progress
|
Undecided
|
Unassigned |
Bug Description
Image_get_all () uses the left outer join method to query the image_tags table, and the conversion to the sql statement is as follows:
```
...
AS anon_1 LEFT OUTER JOIN image_properties AS image_properties_1 ON anon_1.id = image_propertie
...
```
Since there is no subquery on image_tags in advance to remove logically deleted entries, when there are a large number of logically deleted entries in image_tags (such as frequent update image tag), the query will be very slow.
Can we first make a query on the image_tags table when joining the left outer join? For example:
```
...
AS anon_1 LEFT OUTER JOIN image_properties AS image_properties_1 ON anon_1.id = image_propertie
...
```
How can i express such a sql statement in sqlalchemy?
Fix proposed to branch: master /review. opendev. org/c/openstack /glance/ +/862354
Review: https:/