Change lookup of blobs to not use a subquery, which is murder on MySQL
This commit is contained in:
parent
cdb49dbfd3
commit
e309508776
4 changed files with 31 additions and 40 deletions
|
@ -233,15 +233,6 @@ def _get_storage(query_modifier):
|
|||
return found
|
||||
|
||||
|
||||
def get_storage_by_subquery(subquery):
|
||||
""" Returns the storage (and its locations) for the storage id returned by the subquery. The
|
||||
subquery must return at most 1 result, which is a storage ID. """
|
||||
def filter_by_subquery(query):
|
||||
return query.where(ImageStorage.id == subquery)
|
||||
|
||||
return _get_storage(filter_by_subquery)
|
||||
|
||||
|
||||
def get_storage_by_uuid(storage_uuid):
|
||||
def filter_to_uuid(query):
|
||||
return query.where(ImageStorage.uuid == storage_uuid)
|
||||
|
|
Reference in a new issue