Re: order by has no effect in index-choose?

Поиск
Список
Период
Сортировка
Искать

Re: order by has no effect in index-choose?

От:
Harald Krake <harald@krake.de>
Дата:
Klaus Daum wrote:

> i have:
> 
>   create table t (id int, s1 text, s2 text);
>   create index s1 on t using (id, s1);
>   create index s2 on t using (id, s2);
> 
> [fill table t, analyse table t]
> 
>   select * from t where id=1 order by s1;
> 
> -> is using index s2

select * from t where id=1 order by id,s1

will use s1.



FAQ