|
Как избавиться от filesort'a?
|
|||
---|---|---|---|
#18+
собственно вопрос: как избежать filesort на запросе вида "select id from a where t=1 and s<>1 order by id desc limit 10" что-то у меня голова совсем ничего не придумывает :( filesort на 100000 записей при нерегулярном использовании тормозит неприятно :( вот тестовый sql, все время получается "Using filesort"... DROP TABLE IF EXISTS a; create table a ( id int unsigned not null auto_increment primary key, t int unsigned not null, s int unsigned not null ); insert into a(t,s) values(1,1); insert into a(t,s) values(1,2); insert into a(t,s) values(2,1); explain select id from a where t=1 and s<>1 order by id desc limit 10; alter table a add key(t); explain select id from a where t=1 and s<>1 order by id desc limit 10; alter table a add key(s); explain select id from a where t=1 and s<>1 order by id desc limit 10; alter table a add key(t,s); explain select id from a where t=1 and s<>1 order by id desc limit 10; alter table a add key(t,s,id); explain select id from a where t=1 and s<>1 order by id desc limit 10; alter table a add key(s,t,id); explain select id from a where t=1 and s<>1 order by id desc limit 10; alter table a add key(id,t,s); explain select id from a where t=1 and s<>1 order by id desc limit 10; ... |
|||
:
Нравится:
Не нравится:
|
|||
18.03.2004, 14:09 |
|
Как избавиться от filesort'a?
|
|||
---|---|---|---|
#18+
Это не избежно, так как делается на системном уровне, ищи другие узкие места, а про это забуть! ... |
|||
:
Нравится:
Не нравится:
|
|||
18.03.2004, 14:38 |
|
Как избавиться от filesort'a?
|
|||
---|---|---|---|
#18+
попробуй отказаться от сортировки :-( тогда удасться избежать. ... |
|||
:
Нравится:
Не нравится:
|
|||
18.03.2004, 17:33 |
|
Как избавиться от filesort'a?
|
|||
---|---|---|---|
#18+
перевоз всего на interbase/postgresql может помочь? ... |
|||
:
Нравится:
Не нравится:
|
|||
19.03.2004, 20:08 |
|
|
start [/forum/topic.php?fid=47&msg=32447366&tid=1855328]: |
0ms |
get settings: |
10ms |
get forum list: |
14ms |
check forum access: |
4ms |
check topic access: |
4ms |
track hit: |
48ms |
get topic data: |
13ms |
get forum data: |
3ms |
get page messages: |
54ms |
get tp. blocked users: |
2ms |
others: | 15ms |
total: | 167ms |
0 / 0 |