daniel created this task.
daniel added projects: Performance, Wikidata, Wikidata-Sprint-2016-05-24.
Herald added a subscriber: Zppix.

TASK DESCRIPTION

In EntityUsageTable::getUsedEntityIdStrings, we currently use a bulk query to see which Entity ID from a given set are actually present in the wbc_entity_usage table:

SELECT DISTINCT eu_entity_id  FROM `wbc_entity_usage` 
WHERE eu_entity_id IN ('Q148475', 'Q54919', 'Q423048', 'Q2494649', 'Q13219454', 'Q131454', 'Q36578', 'Q1798125', 'Q2597810', 'Q19938912', 'Q193563', 'Q2553334', 'Q477675', 'Q623578', 'Q19675', 'Q13481868', 'Q384602')

This can lead to extremely slow queries and high resource consumption in some cases, as described in T116404#2370849.

We should instead use individual selects with LIMIT 1 for each ID:

SELECT eu_entity_id FROM wbc_entity_usage WHERE eu_entity_id = 'Q623578' LIMIT 1;

@jcrespo suggest that this is the better approach in T116404#2371094.


TASK DETAIL
https://phabricator.wikimedia.org/T137539

EMAIL PREFERENCES
https://phabricator.wikimedia.org/settings/panel/emailpreferences/

To: daniel
Cc: Zppix, Aklapper, hoo, aude, aaron, daniel, jcrespo, Vali.matei, D3r1ck01, Izno, Wikidata-bugs, GWicke, Mbch331
_______________________________________________
Wikidata-bugs mailing list
Wikidata-bugs@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikidata-bugs

Reply via email to