User talk:Catrope/winnipeg

Query 1
mysql> explain SELECT * FROM redirect JOIN page ON rd_from=page_id WHERE page_title='Winnipeg,_Manitoba'; ++-+--++---+-+-+-+-+-+ ++-+--++---+-+-+-+-+-+ ++-+--++---+-+-+-+-+-+ 2 rows in set (0.04 sec)
 * id | select_type | table   | type   | possible_keys | key         | key_len | ref                     | rows    | Extra       |
 * 1 | SIMPLE     | redirect | index  | PRIMARY       | rd_ns_title | 265     | NULL                    | 2007555 | Using index |
 * 1 | SIMPLE     | page     | eq_ref | PRIMARY       | PRIMARY     | 4       | enwiki.redirect.rd_from |       1 | Using where |

mysql> SELECT * FROM redirect JOIN page ON rd_from=page_id WHERE page_title='Winnipeg,_Manitoba'; +-+--+--+-+++---+--+--+-+++-+--+ +-+--+--+-+++---+--+--+-+++-+--+ +-+--+--+-+++---+--+--+-+++-+--+ 1 row in set (54.24 sec)
 * rd_from | rd_namespace | rd_title | page_id | page_namespace | page_title        | page_restrictions | page_counter | page_is_redirect | page_is_new | page_random    | page_touched   | page_latest | page_len |
 * 6842860 |           0 | Winnipeg | 6842860 |              0 | Winnipeg,_Manitoba |                   |            0 |                1 |           0 | 0.246798013048 | 20080331155715 |   201371589 |       58 |

Query 2
mysql> EXPLAIN SELECT * FROM pagelinks JOIN page ON page_id=pl_from WHERE page_title='Winnipeg,_Manitoba'; ++-+---+--+---+-+-+-+--+-+ ++-+---+--+---+-+-+-+--+-+ ++-+---+--+---+-+-+-+--+-+ 2 rows in set (0.00 sec)
 * id | select_type | table    | type | possible_keys | key     | key_len | ref                 | rows     | Extra       |
 * 1 | SIMPLE     | page      | ALL  | PRIMARY       | NULL    | NULL    | NULL                | 12750472 | Using where |
 * 1 | SIMPLE     | pagelinks | ref  | pl_from       | pl_from | 4       | enwiki.page.page_id |        7 | Using index |

mysql> SELECT * FROM pagelinks JOIN page ON page_id=pl_from WHERE page_title='Winnipeg,_Manitoba'; +-+--+--+-+++---+--+--+-+++-+--+ +-+--+--+-+++---+--+--+-+++-+--+ +-+--+--+-+++---+--+--+-+++-+--+ 7 rows in set (1 min 59.36 sec)
 * pl_from | pl_namespace | pl_title                                | page_id | page_namespace | page_title         |page_restrictions | page_counter | page_is_redirect | page_is_new | page_random    | page_touched   | page_latest | page_len |
 * 6842860 |           0 | Canada                                   | 6842860 |              0 | Winnipeg,_Manitoba |                  |            0 |                1 |           0 | 0.246798013048 | 20080331155715 |   201371589 |       58 |
 * 6842860 |           0 | Winnipeg                                 | 6842860 |              0 | Winnipeg,_Manitoba |                  |            0 |                1 |           0 | 0.246798013048 | 20080331155715 |   201371589 |       58 |
 * 6842860 |           4 | CANSTYLE                                 | 6842860 |              0 | Winnipeg,_Manitoba |                  |            0 |                1 |           0 | 0.246798013048 | 20080331155715 |   201371589 |       58 |
 * 6842860 |           4 | Redirect                                 | 6842860 |              0 | Winnipeg,_Manitoba |                  |            0 |                1 |           0 | 0.246798013048 | 20080331155715 |   201371589 |       58 |
 * 6842860 |          14 | Redirects_from_Canadian_settlement_names | 6842860 |              0 | Winnipeg,_Manitoba |                  |            0 |                1 |           0 | 0.246798013048 | 20080331155715 |   201371589 |       58 |
 * 6842860 |          14 | Redirects_from_alternative_names         | 6842860 |              0 | Winnipeg,_Manitoba |                  |            0 |                1 |           0 | 0.246798013048 | 20080331155715 |   201371589 |       58 |
 * 6842861 |           1 | Winnipeg                                 | 6842861 |              1 | Winnipeg,_Manitoba |                  |            0 |                1 |           1 | 0.870473145446 | 20060904194558 |    73808895 |       27 |