Re: order by has no effect in index-choose? - Mailing list pgsql-admin

From Harald Krake
Subject Re: order by has no effect in index-choose?
Date
Msg-id atnito$2hlh$1@news.hub.org
Whole thread Raw
List pgsql-admin
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.




pgsql-admin by date:

Previous
From: "Rajesh Kumar Mallah."
Date:
Subject: Is it harmless?
Next
From: Tom Lane
Date:
Subject: Re: Is it harmless?