- 论坛徽章:
- 0
|
______________________________________________________________________ 001 ___
Count : 194 (91.51%)
Time : 1729 s total, 8.912371 s avg, 6 s to 82 s max (75.67%)
95% of Time : 1395 s total, 7.581522 s avg, 6 s to 15 s max
Lock Time (s) : 0 total, 0 avg, 0 to 0 max (0.00%)
95% of Lock : 0 total, 0 avg, 0 to 0 max
Rows sent : 20 avg, 2 to 20 max (0.05%)
Rows examined : 1.35M avg, 13.74k to 1.77M max (96.53%)
Database :
Users :
dev@ 10.1.1.4 : 100.00% (194) of query, 93.87% (199) of all users
Query abstract:
SELECT * FROM pw_gbook WHERE uid='S' ORDER BY postdate DESC LIMIT N,N;
Query sample:
SELECT * FROM pw_gbook WHERE uid='48' ORDER BY postdate DESC LIMIT 1758260,20;
mysql> explain SELECT * FROM pw_gbook WHERE uid='48' ORDER BY postdate DESC LIMIT 1758260,20;
+----+-------------+----------+------+---------------+------+---------+-------+---------+-------------+
| id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra |
+----+-------------+----------+------+---------------+------+---------+-------+---------+-------------+
| 1 | SIMPLE | pw_gbook | ref | uid | uid | 3 | const | 1781796 | Using where |
+----+-------------+----------+------+---------------+------+---------+-------+---------+-------------+
1 row in set (0.02 sec)
mysql> desc pw_gbook;
ERROR 2006 (HY000): MySQL server has gone away
No connection. Trying to reconnect...
Connection id: 1547955
Current database: gbook
+-----------+--------------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+-----------+--------------+------+-----+---------+----------------+
| id | int(11) | NO | PRI | NULL | auto_increment |
| uid | mediumint( | NO | MUL | 0 | |
| author | varchar(20) | NO | | | |
| authorid | mediumint( | NO | | 0 | |
| type | tinyint(1) | NO | | 0 | |
| postdate | int(10) | NO | | 0 | |
| content | text | NO | | NULL | |
| replydate | int(10) | NO | | 0 | |
| reply | text | NO | | NULL | |
+-----------+--------------+------+-----+---------+----------------+
9 rows in set (0.00 sec)
mysql> show index from pw_gbook;
ERROR 2006 (HY000): MySQL server has gone away
No connection. Trying to reconnect...
Connection id: 1548014
Current database: gbook
+----------+------------+----------+--------------+-------------+-----------+-------------+----------+--------+------+------------+---------+
| Table | Non_unique | Key_name | Seq_in_index | Column_name | Collation | Cardinality | Sub_part | Packed | Null | Index_type | Comment |
+----------+------------+----------+--------------+-------------+-----------+-------------+----------+--------+------+------------+---------+
| pw_gbook | 0 | PRIMARY | 1 | id | A | 2394289 | NULL | NULL | | BTREE | |
| pw_gbook | 1 | uid | 1 | uid | A | 42755 | NULL | NULL | | BTREE | |
| pw_gbook | 1 | uid | 2 | postdate | A | 2394289 | NULL | NULL | | BTREE | |
+----------+------------+----------+--------------+-------------+-----------+-------------+----------+--------+------+------------+---------+
3 rows in set (0.00 sec)
mysql>
[ 本帖最后由 小木虫子 于 2009-11-3 13:11 编辑 ] |
|