https://bugzilla.wikimedia.org/show_bug.cgi?id=14971





--- Comment #19 from Aryeh Gregor <simetrical+wikib...@gmail.com>  2009-01-21 
17:31:23 UTC ---
EXPLAINs on enwikinews_p from toolserver:

mysql> EXPLAIN SELECT page_namespace, page_title, c1.cl_timestamp FROM `page`
INNER JOIN `categorylinks` AS c1 ON page_id = c1.cl_from AND c1.cl_to='Test'
WHERE 1=1 AND page_is_redirect = 0 ORDER BY c1.cl_timestamp DESC;
+----+-------------+---------------+--------+---------------------------------+--------------+---------+----------------------------------+------+--------------------------+
| id | select_type | table         | type   | possible_keys                   |
key          | key_len | ref                              | rows | Extra       
            |
+----+-------------+---------------+--------+---------------------------------+--------------+---------+----------------------------------+------+--------------------------+
|  1 | SIMPLE      | categorylinks | ref    | cl_from,cl_timestamp,cl_sortkey |
cl_timestamp | 257     | const                            |    1 | Using where;
Using index | 
|  1 | SIMPLE      | page          | eq_ref | PRIMARY                         |
PRIMARY      | 4       | enwikinews.categorylinks.cl_from |    1 | Using where 
            | 
+----+-------------+---------------+--------+---------------------------------+--------------+---------+----------------------------------+------+--------------------------+
2 rows in set (0.03 sec)

mysql> EXPLAIN SELECT page_namespace, page_title, c1.cl_timestamp FROM `page`
INNER JOIN `categorylinks` AS c1 ON page_id = c1.cl_from AND c1.cl_to='Test'
WHERE 1=1 AND page_is_redirect = 0 ORDER BY page_touched DESC;
+----+-------------+---------------+--------+---------------------------------+--------------+---------+----------------------------------+------+-----------------------------------------------------------+
| id | select_type | table         | type   | possible_keys                   |
key          | key_len | ref                              | rows | Extra       
                                             |
+----+-------------+---------------+--------+---------------------------------+--------------+---------+----------------------------------+------+-----------------------------------------------------------+
|  1 | SIMPLE      | categorylinks | ref    | cl_from,cl_timestamp,cl_sortkey |
cl_timestamp | 257     | const                            |    1 | Using where;
Using index; Using temporary; Using filesort | 
|  1 | SIMPLE      | page          | eq_ref | PRIMARY                         |
PRIMARY      | 4       | enwikinews.categorylinks.cl_from |    1 | Using where 
                                             | 
+----+-------------+---------------+--------+---------------------------------+--------------+---------+----------------------------------+------+-----------------------------------------------------------+
2 rows in set (0.00 sec)

mysql> EXPLAIN SELECT page_namespace, page_title, c1.cl_timestamp FROM `page`
INNER JOIN `categorylinks` AS c1 ON page_id = c1.cl_from AND c1.cl_to='Test'
WHERE 1=1 AND page_is_redirect = 0 ORDER BY page_title DESC;
+----+-------------+---------------+--------+---------------------------------+--------------+---------+----------------------------------+------+-----------------------------------------------------------+
| id | select_type | table         | type   | possible_keys                   |
key          | key_len | ref                              | rows | Extra       
                                             |
+----+-------------+---------------+--------+---------------------------------+--------------+---------+----------------------------------+------+-----------------------------------------------------------+
|  1 | SIMPLE      | categorylinks | ref    | cl_from,cl_timestamp,cl_sortkey |
cl_timestamp | 257     | const                            |    1 | Using where;
Using index; Using temporary; Using filesort | 
|  1 | SIMPLE      | page          | eq_ref | PRIMARY                         |
PRIMARY      | 4       | enwikinews.categorylinks.cl_from |    1 | Using where 
                                             | 
+----+-------------+---------------+--------+---------------------------------+--------------+---------+----------------------------------+------+-----------------------------------------------------------+
2 rows in set (0.00 sec)

If the middle query is actually being run, the last one shouldn't be any worse,
I suppose.  But it still looks bad.  I'm very reluctant to commit this,
especially since I've never used the extension and am not familiar with its
code.  Sorry.


-- 
Configure bugmail: https://bugzilla.wikimedia.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
You are on the CC list for the bug.

_______________________________________________
Wikibugs-l mailing list
Wikibugs-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l

Reply via email to