| Marostegui added a comment. |
@Ladsgroup I am not sure we should keep on with this task - looks like removing wb_terms_search_key isn't a good idea:
Look at this:
root@db1092[wikidatawiki]> show indexes from wb_terms; +----------+------------+------------------+--------------+---------------------+-----------+-------------+----------+--------+------+------------+---------+---------------+ | Table | Non_unique | Key_name | Seq_in_index | Column_name | Collation | Cardinality | Sub_part | Packed | Null | Index_type | Comment | Index_comment | +----------+------------+------------------+--------------+---------------------+-----------+-------------+----------+--------+------+------------+---------+---------------+ | wb_terms | 0 | PRIMARY | 1 | term_row_id | A | 1652608049 | NULL | NULL | | BTREE | | | | wb_terms | 1 | wb_terms_text | 1 | term_text | A | 275434674 | NULL | NULL | | BTREE | | | | wb_terms | 1 | term_full_entity | 1 | term_full_entity_id | A | 118043432 | NULL | NULL | YES | BTREE | | | +----------+------------+------------------+--------------+---------------------+-----------+-------------+----------+--------+------+------------+---------+---------------+ 3 rows in set (0.00 sec)
root@db1092[wikidatawiki]> explain SELECT /* Wikibase\Lib\Store\Sql\TermSqlIndex::getMatchingTerms 2A03:2880:30:2F... */ term_entity_type,term_type,term_language,term_text,term_weight,term_full_entity_id FROM `wb_terms` WHERE ((term_language = 'bn' AND term_search_key = 'মুসোলিনীর' AND term_type = 'label' AND term_entity_type = 'item') OR (term_language = 'bn' AND term_search_key = 'মুসোলিনীর' AND term_type = 'alias' AND term_entity_type = 'item')) LIMIT 2500; +------+-------------+----------+------+---------------+------+---------+------+------------+-------------+ | id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra | +------+-------------+----------+------+---------------+------+---------+------+------------+-------------+ | 1 | SIMPLE | wb_terms | ALL | NULL | NULL | NULL | NULL | 1652608451 | Using where | +------+-------------+----------+------+---------------+------+---------+------+------------+-------------+ 1 row in set (0.00 sec)
root@db1104[wikidatawiki]> show indexes from wb_terms; +----------+------------+---------------------+--------------+---------------------+-----------+-------------+----------+--------+------+------------+---------+---------------+ | Table | Non_unique | Key_name | Seq_in_index | Column_name | Collation | Cardinality | Sub_part | Packed | Null | Index_type | Comment | Index_comment | +----------+------------+---------------------+--------------+---------------------+-----------+-------------+----------+--------+------+------------+---------+---------------+ | wb_terms | 0 | PRIMARY | 1 | term_row_id | A | 1683951612 | NULL | NULL | | BTREE | | | | wb_terms | 1 | wb_terms_entity_id | 1 | term_entity_id | A | 99055977 | NULL | NULL | | BTREE | | | | wb_terms | 1 | wb_terms_text | 1 | term_text | A | 240564516 | NULL | NULL | | BTREE | | | | wb_terms | 1 | wb_terms_search_key | 1 | term_search_key | A | 64767369 | NULL | NULL | | BTREE | | | | wb_terms | 1 | tmp1 | 1 | term_language | A | 6378604 | NULL | NULL | | BTREE | | | | wb_terms | 1 | tmp1 | 2 | term_type | A | 8547977 | NULL | NULL | | BTREE | | | | wb_terms | 1 | tmp1 | 3 | term_entity_type | A | 6330645 | NULL | NULL | | BTREE | | | | wb_terms | 1 | tmp1 | 4 | term_search_key | A | 420987903 | NULL | NULL | | BTREE | | | | wb_terms | 1 | term_full_entity | 1 | term_full_entity_id | A | 112263440 | NULL | NULL | YES | BTREE | | | | wb_terms | 1 | term_search_full | 1 | term_language | A | 7075426 | NULL | NULL | | BTREE | | | | wb_terms | 1 | term_search_full | 2 | term_full_entity_id | A | 1683951612 | NULL | NULL | YES | BTREE | | | | wb_terms | 1 | term_search_full | 3 | term_type | A | 1683951612 | NULL | NULL | | BTREE | | | | wb_terms | 1 | term_search_full | 4 | term_search_key | A | 1683951612 | 16 | NULL | | BTREE | | | +----------+------------+---------------------+--------------+---------------------+-----------+-------------+----------+--------+------+------------+---------+---------------+ 13 rows in set (0.00 sec) root@db1104[wikidatawiki]> explain SELECT /* Wikibase\Lib\Store\Sql\TermSqlIndex::getMatchingTerms 2A03:2880:30:2F... */ term_entity_type,term_type,term_language,term_text,term_weight,term_full_entity_id FROM `wb_terms` WHERE ((term_language = 'bn' AND term_search_key = 'মুসোলিনীর' AND term_type = 'label' AND term_entity_type = 'item') OR (term_language = 'bn' AND term_search_key = 'মুসোলিনীর' AND term_type = 'alias' AND term_entity_type = 'item')) LIMIT 2500; +------+-------------+----------+------+-------------------------------------------+---------------------+---------+-------+------+------------------------------------+ | id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra | +------+-------------+----------+------+-------------------------------------------+---------------------+---------+-------+------+------------------------------------+ | 1 | SIMPLE | wb_terms | ref | wb_terms_search_key,tmp1,term_search_full | wb_terms_search_key | 257 | const | 1 | Using index condition; Using where | +------+-------------+----------+------+-------------------------------------------+---------------------+---------+-------+------+------------------------------------+ 1 row in set (0.00 sec)
TASK DETAIL
EMAIL PREFERENCES
To: Marostegui
Cc: Stashbot, gerritbot, Marostegui, Aklapper, Lucas_Werkmeister_WMDE, Jonas, jcrespo, Ladsgroup, Versusxo, Majesticalreaper22, Giuliamocci, Adrian1985, Cpaulf30, Lahi, Gq86, Baloch007, Darkminds3113, Bsandipan, Lordiis, GoranSMilovanovic, Adik2382, Th3d3v1ls, Ramalepe, Liugev6, QZanden, LawExplorer, Lewizho99, Minhnv-2809, Maathavan, Luke081515, Wikidata-bugs, aude, Mbch331, Jay8g, Krenair
Cc: Stashbot, gerritbot, Marostegui, Aklapper, Lucas_Werkmeister_WMDE, Jonas, jcrespo, Ladsgroup, Versusxo, Majesticalreaper22, Giuliamocci, Adrian1985, Cpaulf30, Lahi, Gq86, Baloch007, Darkminds3113, Bsandipan, Lordiis, GoranSMilovanovic, Adik2382, Th3d3v1ls, Ramalepe, Liugev6, QZanden, LawExplorer, Lewizho99, Minhnv-2809, Maathavan, Luke081515, Wikidata-bugs, aude, Mbch331, Jay8g, Krenair
_______________________________________________ Wikidata-bugs mailing list [email protected] https://lists.wikimedia.org/mailman/listinfo/wikidata-bugs
