hoo added a comment.

I've benchmarked the above query very briefly (picked db1092 for that, all queries were run five times in a row(!)).

Original query

SELECT /* Wikibase\Lib\Store\Sql\SqlEntityInfoBuilder::collectTermsForEntities  */  term_entity_type,term_entity_id,term_type,term_language,term_text  FROM `wb_terms`    WHERE term_entity_type = 'property' AND term_entity_id IN ('373','374','248','143','17','131','582','580','625','813','31','646','577','1566','18','214','268','856','2046','94','281','242','47','1082','585')  AND term_type IN ('label','description')  AND term_language = 'en';

5.324s on average


One query per term_type (above query but term_type = 'description'/ term_type = 'label' rather than the term_type IN ('label','description')):
0.028s on average (for both queries combined).

I conclude that we should run one query per term type here and simply merge the result in the application code.


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

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

To: hoo
Cc: Stashbot, hoo, MZMcBride, TerraCodes, Luke081515, Jay8g, Aklapper, jcrespo, D3r1ck01, Izno, Wikidata-bugs, aude, Mbch331, Krenair
_______________________________________________
Wikidata-bugs mailing list
Wikidata-bugs@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikidata-bugs

Reply via email to