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

Sam Reed (reedy) <[email protected]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |[email protected]

--- Comment #1 from Sam Reed (reedy) <[email protected]> 2012-07-17 21:18:00 
UTC ---
We can MiserMode and call $dbw->estimateRowCount on the bad queries... ;)

The only really slow query is the distinct revision count, but even then this
isn't too bad.

page_counter is useless for WMF usage... And is half based on
$wgDisableCounters

https://gerrit.wikimedia.org/r/#/c/15840/
https://gerrit.wikimedia.org/r/#/c/15844/


mysql> explain select count(*) from watchlist where wl_title = 'Barack_Obama'
AND wl_namespace = '0';
+----+-------------+-----------+------+-----------------+-----------------+---------+-------------+------+--------------------------+
| id | select_type | table     | type | possible_keys   | key             |
key_len | ref         | rows | Extra                    |
+----+-------------+-----------+------+-----------------+-----------------+---------+-------------+------+--------------------------+
|  1 | SIMPLE      | watchlist | ref  | namespace_title | namespace_title | 261
    | const,const | 4060 | Using where; Using index |
+----+-------------+-----------+------+-----------------+-----------------+---------+-------------+------+--------------------------+
1 row in set (0.00 sec)

mysql> select count(*) from watchlist where wl_title = 'Barack_Obama' AND
wl_namespace = '0';
+----------+
| count(*) |
+----------+
|     2234 |
+----------+
1 row in set (0.00 sec)

mysql> select count(*) from watchlist where wl_namespace = '0' AND wl_title =
'Barack_Obama';
+----------+
| count(*) |
+----------+
|     2234 |
+----------+
1 row in set (0.00 sec)

mysql> select * from page where page_namespace = 0 and page_title =
'Barack_Obama';
+---------+----------------+--------------+-------------------+--------------+------------------+-------------+----------------+----------------+-------------+----------+
| page_id | page_namespace | page_title   | page_restrictions | page_counter |
page_is_redirect | page_is_new | page_random    | page_touched   | page_latest
| page_len |
+---------+----------------+--------------+-------------------+--------------+------------------+-------------+----------------+----------------+-------------+----------+
|  534366 |              0 | Barack_Obama |                   |            0 | 
              0 |           0 | 0.379391504628 | 20120717194453 |   502845086 |
  203903 |
+---------+----------------+--------------+-------------------+--------------+------------------+-------------+----------------+----------------+-------------+----------+
1 row in set (0.00 sec)

mysql> explain select count(rev_page) from revision where rev_page = 534366;
+----+-------------+----------+------+------------------------+----------------+---------+-------+-------+-------------+
| id | select_type | table    | type | possible_keys          | key           
| key_len | ref   | rows  | Extra       |
+----+-------------+----------+------+------------------------+----------------+---------+-------+-------+-------------+
|  1 | SIMPLE      | revision | ref  | PRIMARY,page_timestamp | page_timestamp
| 4       | const | 17160 | Using index |
+----+-------------+----------+------+------------------------+----------------+---------+-------+-------+-------------+
1 row in set (0.00 sec)

mysql> select count(rev_page) from revision where rev_page = 534366;
+-----------------+
| count(rev_page) |
+-----------------+
|           22257 |
+-----------------+
1 row in set (0.01 sec)

mysql> explain select COUNT(DISTINCT rev_user_text) from revision where
rev_page = 534366;
+----+-------------+----------+-------+------------------------+---------+---------+------+-------+-------------+
| id | select_type | table    | type  | possible_keys          | key     |
key_len | ref  | rows  | Extra       |
+----+-------------+----------+-------+------------------------+---------+---------+------+-------+-------------+
|  1 | SIMPLE      | revision | range | PRIMARY,page_timestamp | PRIMARY | 4   
   | NULL | 38318 | Using where |
+----+-------------+----------+-------+------------------------+---------+---------+------+-------+-------------+
1 row in set (0.02 sec)

mysql> select COUNT(DISTINCT rev_user_text) from revision where rev_page =
534366;
+-------------------------------+
| COUNT(DISTINCT rev_user_text) |
+-------------------------------+
|                          5923 |
+-------------------------------+
1 row in set (1.03 sec)

mysql> select page_counter from revision where rev_page = 534366;
ERROR 1054 (42S22): Unknown column 'page_counter' in 'field list'
mysql> select page_counter from page where page_id = 534366;
+--------------+
| page_counter |
+--------------+
|            0 |
+--------------+
1 row in set (0.00 sec)

mysql> select * from page where page_id = 534366;
+---------+----------------+--------------+-------------------+--------------+------------------+-------------+----------------+----------------+-------------+----------+
| page_id | page_namespace | page_title   | page_restrictions | page_counter |
page_is_redirect | page_is_new | page_random    | page_touched   | page_latest
| page_len |
+---------+----------------+--------------+-------------------+--------------+------------------+-------------+----------------+----------------+-------------+----------+
|  534366 |              0 | Barack_Obama |                   |            0 | 
              0 |           0 | 0.379391504628 | 20120717194453 |   502845086 |
  203903 |
+---------+----------------+--------------+-------------------+--------------+------------------+-------------+----------------+----------------+-------------+----------+
1 row in set (0.00 sec)

-- 
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
[email protected]
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l

Reply via email to