| Ladsgroup added a comment. |
In T215902#4964138, @Addshore wrote:Queries end up going from something like this:
SELECT term_full_entity_id FROM wb_terms WHERE term_text = 'Berlin' AND (term_type = 'label' OR term_type = 'alias') AND term_language = 'en';To something like this:
SELECT entity_id, wb_entity_term_type.type as type, wb_term_search_langs.language as lang, wb_term_search_strings.term_text as text FROM wb_page_to_entity INNER JOIN wb_entity_terms_2 ON wb_page_to_entity.page_id = wb_entity_terms_2.page_id INNER JOIN wb_term_search_langstringtype ON wb_entity_terms_2.langstringtype = wb_term_search_langstringtype.id INNER JOIN wb_term_search_langstring ON wb_term_search_langstringtype.langstring = wb_term_search_langstring.id INNER JOIN wb_term_search_langs ON wb_term_search_langstring.term_language = wb_term_search_langs.id INNER JOIN wb_term_search_strings ON wb_term_search_langstring.term_text = wb_term_search_strings.id INNER JOIN wb_entity_term_type ON wb_term_search_langstringtype.type = wb_entity_term_type.id WHERE wb_term_search_strings.term_text = 'Berlin' AND (wb_entity_term_type.type = 'label' OR wb_entity_term_type.type = 'alias') AND wb_term_search_langs.language = 'en';
I don't know if this is being considered but we definitely should do join decomposition in most of these cases for example entity_type, term_type, etc. That way this can be cached in several layers (like MySQL cache, services cache in mediawiki). Pretty much similar to NameTableStore that's being used for normalized tables.
TASK DETAIL
EMAIL PREFERENCES
To: Addshore, Ladsgroup
Cc: Lucas_Werkmeister_WMDE, alaa_wmde, JeroenDeDauw, Ladsgroup, Marostegui, Aklapper, Addshore, Nandana, Lahi, Gq86, GoranSMilovanovic, QZanden, LawExplorer, _jensen, Jonas, Wikidata-bugs, aude, Lydia_Pintscher, Mbch331
Cc: Lucas_Werkmeister_WMDE, alaa_wmde, JeroenDeDauw, Ladsgroup, Marostegui, Aklapper, Addshore, Nandana, Lahi, Gq86, GoranSMilovanovic, QZanden, LawExplorer, _jensen, Jonas, Wikidata-bugs, aude, Lydia_Pintscher, Mbch331
_______________________________________________ Wikidata-bugs mailing list [email protected] https://lists.wikimedia.org/mailman/listinfo/wikidata-bugs
