- 论坛徽章:
- 0
|
原帖由 cenalulu 于 2009-12-18 10:54 发表
slow query的话还是应该先从语句入手。。。
别急着调参数。
用mysqlsla 查看 主要 是这条sql语句很厉害,有75.86%
以前没调整索引大小的时候这个比例是88%,现在好像降下来一点了
Count : 14.37k (75.86%)
Time : 967006 s total, 67.302756 s avg, 2 s to 22138 s max (54.62%)
95% of Time : 40419 s total, 2.961316 s avg, 2 s to 7 s max
Lock Time (s) : 531915 s total, 37.02081 s avg, 0 to 20884 s max (40.59%)
95% of Lock : 0 total, 0 avg, 0 to 0 max
Rows sent : 17 avg, 0 to 20 max (83.54%)
Rows examined : 3.60k avg, 12 to 4.62M max (68.03%)
Database : tb
Users :
root@localhost : 100.00% (1436 of query, 93.50% (17709) of all users
Query abstract:
SELECT iid,title,pic_path,price FROM tb_goods WHERE nick='S' ORDER BY lmsn DESC LIMIT N,N;
explain Query :
mysql> explain select iid,title,pic_path,price from tb_goods where nick='vivizone' order by lmsn desc limit 480,20 \G;
*************************** 1. row ***************************
id: 1
select_type: SIMPLE
table: tb_goods
type: ref
possible_keys: nickgood
key: nickgood
key_len: 32
ref: const
rows: 806
Extra: Using where
1 row in set (0.00 sec) |
|