Addshore added a comment.

  Looks like a different index would be beneficial here...
  
  The query posted above.
  
    
+------+--------------------+--------------------+--------+----------------------------------------------------------------------------------------------------------------------------------------------+----------------------+---------+------------------------------------------+---------+-------------+
    | id   | select_type        | table              | type   | possible_keys   
                                                                                
                                             | key                  | key_len | 
ref                                      | rows    | Extra       |
    
+------+--------------------+--------------------+--------+----------------------------------------------------------------------------------------------------------------------------------------------+----------------------+---------+------------------------------------------+---------+-------------+
    |    1 | PRIMARY            | recentchanges      | range  | 
rc_timestamp,new_name_timestamp,tmp_2,tmp_3,rc_name_type_patrolled_timestamp,rc_ns_actor,rc_actor,rc_namespace_title_timestamp,rc_this_oldid
 | rc_timestamp         | 16      | NULL                                     | 
9830478 | Using where |
    |    1 | PRIMARY            | actor_rc_user      | eq_ref | PRIMARY         
                                                                                
                                             | PRIMARY              | 8       | 
wikidatawiki.recentchanges.rc_actor      |       1 |             |
    |    1 | PRIMARY            | page               | eq_ref | PRIMARY         
                                                                                
                                             | PRIMARY              | 4       | 
wikidatawiki.recentchanges.rc_cur_id     |       1 | Using where |
    |    1 | PRIMARY            | comment_rc_comment | eq_ref | PRIMARY         
                                                                                
                                             | PRIMARY              | 8       | 
wikidatawiki.recentchanges.rc_comment_id |       1 |             |
    |    2 | DEPENDENT SUBQUERY | change_tag         | ref    | 
change_tag_rc_tag_id,change_tag_tag_id_id                                       
                                                             | 
change_tag_rc_tag_id | 5       | wikidatawiki.recentchanges.rc_id         |     
  1 | Using index |
    |    2 | DEPENDENT SUBQUERY | change_tag_def     | eq_ref | PRIMARY         
                                                                                
                                             | PRIMARY              | 4       | 
wikidatawiki.change_tag.ct_tag_id        |       1 |             |
    
+------+--------------------+--------------------+--------+----------------------------------------------------------------------------------------------------------------------------------------------+----------------------+---------+------------------------------------------+---------+-------------+
  
  With FORCE INDEX (tmp_3) on recentchanges it returns in 3.5 seconds.
  
    
+------+--------------------+--------------------+--------+-------------------------------------------+----------------------+---------+------------------------------------------+--------+----------------------------------------------------+
    | id   | select_type        | table              | type   | possible_keys   
                          | key                  | key_len | ref                
                      | rows   | Extra
                                         |
    
+------+--------------------+--------------------+--------+-------------------------------------------+----------------------+---------+------------------------------------------+--------+----------------------------------------------------+
    |    1 | PRIMARY            | recentchanges      | range  | tmp_3           
                          | tmp_3                | 20      | NULL               
                      | 347046 | Using index condition; Using where; Using 
filesort |
    |    1 | PRIMARY            | actor_rc_user      | eq_ref | PRIMARY         
                          | PRIMARY              | 8       | 
wikidatawiki.recentchanges.rc_actor      |      1 |
                                         |
    |    1 | PRIMARY            | page               | eq_ref | PRIMARY         
                          | PRIMARY              | 4       | 
wikidatawiki.recentchanges.rc_cur_id     |      1 | Using where
                                         |
    |    1 | PRIMARY            | comment_rc_comment | eq_ref | PRIMARY         
                          | PRIMARY              | 8       | 
wikidatawiki.recentchanges.rc_comment_id |      1 |
                                         |
    |    2 | DEPENDENT SUBQUERY | change_tag         | ref    | 
change_tag_rc_tag_id,change_tag_tag_id_id | change_tag_rc_tag_id | 5       | 
wikidatawiki.recentchanges.rc_id         |      1 | Using index
                                         |
    |    2 | DEPENDENT SUBQUERY | change_tag_def     | eq_ref | PRIMARY         
                          | PRIMARY              | 4       | 
wikidatawiki.change_tag.ct_tag_id        |      1 |
                                         |
    
+------+--------------------+--------------------+--------+-------------------------------------------+----------------------+---------+------------------------------------------+--------+----------------------------------------------------+

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

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

To: Addshore
Cc: Addshore, Umherirrender, DannyS712, Aklapper, darthmon_wmde, Nandana, 
kostajh, Jony, Lahi, Gq86, Darkminds3113, Pablo-WMDE, GoranSMilovanovic, 
QZanden, LawExplorer, Vali.matei, _jensen, rosalieper, Taiwania_Justo, 
Scott_WUaS, Jonas, Volker_E, Wikidata-bugs, aude, GWicke, Dinoguy1000, 
Lydia_Pintscher, Jdforrester-WMF, Mbch331, Rxy, Jay8g, Krenair
_______________________________________________
Wikidata-bugs mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/wikidata-bugs

Reply via email to