Новые сообщения [новые:0]
Дайджест
Горячие темы
Избранное [новые:0]
Форумы
Пользователи
Статистика
Статистика нагрузки
Мод. лог
Поиск
|
18.03.2004, 14:09
|
|||
---|---|---|---|
|
|||
Как избавиться от 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:38
|
|||
---|---|---|---|
Как избавиться от filesort'a? |
|||
#18+
Это не избежно, так как делается на системном уровне, ищи другие узкие места, а про это забуть! ... |
|||
:
Нравится:
Не нравится:
|
|||
|
18.03.2004, 17:33
|
|||
---|---|---|---|
Как избавиться от filesort'a? |
|||
#18+
попробуй отказаться от сортировки :-( тогда удасться избежать. ... |
|||
:
Нравится:
Не нравится:
|
|||
|
19.03.2004, 20:08
|
|||
---|---|---|---|
|
|||
Как избавиться от filesort'a? |
|||
#18+
перевоз всего на interbase/postgresql может помочь? ... |
|||
:
Нравится:
Не нравится:
|
|||
|
|
start [/forum/topic.php?fid=47&tablet=1&tid=1855328]: |
0ms |
get settings: |
11ms |
get forum list: |
12ms |
check forum access: |
3ms |
check topic access: |
3ms |
track hit: |
59ms |
get topic data: |
11ms |
get forum data: |
2ms |
get page messages: |
39ms |
get tp. blocked users: |
1ms |
others: | 329ms |
total: | 470ms |
0 / 0 |