Page MenuHomePhabricator

Optimize TermSqlCache::saveTermsOfEntity to only update the table if actually neccessary
Closed, ResolvedPublic

Description

Currently, TermSqlCache::saveTermsOfEntity will detect whether the entity's terms are different from the ones stored in the database for the entity's ID. If there is any change, it will delete all terms for the entity, and re-save all terms.

Instead, it would be nice to just delete the terms that were since removed from, and add just the ones that got added to the entity.


Version: unspecified
Severity: major
Whiteboard: backlog, termsearch

Details

Reference
bz42992

Event Timeline

bzimport raised the priority of this task from to High.Nov 22 2014, 1:06 AM
bzimport set Reference to bz42992.
bzimport added a subscriber: Unknown Object (MLST).

Bumping prio - implementing this is pretty simple, and it would reduce database load quite a bit.

Change 99187 had a related patch set uploaded by Daniel Kinzler:
(bug 42992) reduce churn on wb_terms table.

https://gerrit.wikimedia.org/r/99187

Change 99187 merged by Jeroen De Dauw:
(bug 42992) reduce churn on wb_terms table.

https://gerrit.wikimedia.org/r/99187