Addshore added a comment.

P8075 actually creates slightly wrong tables (well one of them with the wrong indexes).

The change would be to the _2 table here:

test_wikiadmin@db1111(wikidatawiki)> show index from wb_entity_terms;
+-----------------+------------+----------------+--------------+----------------+-----------+-------------+----------+--------+------+------------+---------+---------------+
| Table           | Non_unique | Key_name       | Seq_in_index | Column_name    | Collation | Cardinality | Sub_part | Packed | Null | Index_type | Comment | Index_comment |
+-----------------+------------+----------------+--------------+----------------+-----------+-------------+----------+--------+------+------------+---------+---------------+
| wb_entity_terms |          0 | PRIMARY        |            1 | id             | A         |  1809036849 |     NULL | NULL   |      | BTREE      |         |               |
| wb_entity_terms |          0 | unique_content |            1 | page_id        | A         |    86144611 |     NULL | NULL   |      | BTREE      |         |               |
| wb_entity_terms |          0 | unique_content |            2 | langstringtype | A         |  1809036849 |     NULL | NULL   |      | BTREE      |         |               |
+-----------------+------------+----------------+--------------+----------------+-----------+-------------+----------+--------+------+------------+---------+---------------+
3 rows in set (0.00 sec)

test_wikiadmin@db1111(wikidatawiki)> show index from wb_entity_terms_2;
+-------------------+------------+---------------+--------------+----------------+-----------+-------------+----------+--------+------+------------+---------+---------------+
| Table             | Non_unique | Key_name      | Seq_in_index | Column_name    | Collation | Cardinality | Sub_part | Packed | Null | Index_type | Comment | Index_comment |
+-------------------+------------+---------------+--------------+----------------+-----------+-------------+----------+--------+------+------------+---------+---------------+
| wb_entity_terms_2 |          0 | PRIMARY       |            1 | id             | A         |  1802836762 |     NULL | NULL   |      | BTREE      |         |               |
| wb_entity_terms_2 |          1 | page_index    |            1 | page_id        | A         |    78384207 |     NULL | NULL   |      | BTREE      |         |               |
| wb_entity_terms_2 |          1 | content_index |            1 | langstringtype | A         |   901418381 |     NULL | NULL   |      | BTREE      |         |               |
+-------------------+------------+---------------+--------------+----------------+-----------+-------------+----------+--------+------+------------+---------+---------------+
3 rows in set (0.00 sec)

This allows completing the last join needed to get from a (lang,string,type) to a page_id which can then be joined to find entity id (wb_page_to_entity)


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

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

To: Addshore
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

Reply via email to