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

From: Geoff Winkless <pgsqladmin(at)geoff(dot)dj>
To: ar(at)zeit(dot)io, pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Re: Why order by column not using index with distinct keyword in select clause?
Date: 2018-09-11 14:22:03
Message-ID: CAEzk6fdjd7SLk+OvHqTErMwTRs3QvdaUg+T6dY2TrK0zZG6w4A@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Tue, 11 Sep 2018 at 13:56, Arup Rakshit <ar(at)zeit(dot)io> 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?
>

Bear in mind that index skip scans aren't yet implemented, which (unless
I've missed the point) seems to be what you're expecting to help here.

https://wiki.postgresql.org/wiki/Loose_indexscan

Geoff

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Peter Eisentraut 2018-09-11 14:32:27 Re: scram-sha-256 authentication broken in FIPS mode
Previous Message Tom Lane 2018-09-11 14:07:08 Re: Why order by column not using index with distinct keyword in select clause?