Re: Why order by column not using index with distinct keyword in select clause?

2018-09-11 Thread Geoff Winkless
On Tue, 11 Sep 2018 at 13:56, Arup Rakshit wrote: > I have define a simple B Tree index on column *country* for users table. I > don’t understand why the order by column not using the index scan when > using *distinct* keyword in the select clause. Can anyone explain what is > happening here? >

Re: Why order by column not using index with distinct keyword in select clause?

2018-09-11 Thread Tom Lane
Arup Rakshit writes: > I have define a simple B Tree index on column *country* for users table. I > don’t understand why the order by column not using the index scan when using > *distinct* keyword in the select clause. Can anyone explain what is happening > here? Doesn't look complicated to

Why order by column not using index with distinct keyword in select clause?

2018-09-11 Thread Arup Rakshit
I have define a simple B Tree index on column *country* for users table. I don’t understand why the order by column not using the index scan when using *distinct* keyword in the select clause. Can anyone explain what is happening here? aruprakshit=# \d users;