Closed Bug 1181626 Opened 10 years ago Closed 10 years ago

Optimize DB queries while fetching entities

Categories

(Webtools Graveyard :: Pontoon, defect)

defect
Not set
normal

Tracking

(firefox42 affected)

RESOLVED INVALID
Tracking Status
firefox42 --- affected

People

(Reporter: mathjazz, Unassigned)

Details

In dump() and extract() methods, we're fetching individual entities from the database one at a time. It'd be better if we just fetched them all at once for the resource and then searched the returned list for each entity: entities = Entity.objects.filter(resource=resource, obsolete=False) entity = first_or_none(entities, lambda e: e.key == key) More details: https://github.com/mathjazz/pontoon/commit/4daab1ef04312f173dcd443a928b7c430034830e#commitcomment-12049337
Will be fixed automatically when bug 1178874 is fixed.
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → INVALID
Product: Webtools → Webtools Graveyard
You need to log in before you can comment on or make changes to this bug.