pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Adrian Klaver <adrian.klaver@aklaver.com>
To: Arup Rakshit <ar@zeit.io>
To: Ravi Krishna <srkrishna1@aol.com>
Cc: pgsql-general@postgresql.org
Subject: Re: Why my query not using index to sort?
Date: Fri, 28 Sep 2018 06:29:48 -0700
Message-ID: <e8f8d7d8-044b-829f-a063-cb79f6e11d2b@aklaver.com> (raw)
In-Reply-To: <BFE70F8F-4F4A-431F-BF73-A648BF108C83@zeit.io>
References: <1179827344.882330.1538140134266.ref@mail.yahoo.com>
	<1179827344.882330.1538140134266@mail.yahoo.com>
	<BFE70F8F-4F4A-431F-BF73-A648BF108C83@zeit.io>

On 9/28/18 6:19 AM, Arup Rakshit wrote:
> Hi Ravi,
> 
> 
> Yes you are right. It seems it is doing sorting in memory by name. But I 
> have `name` column in index.

You are looking for the vessels.company_id not vessels.name so not sure 
why you expect an index lookup on name?

> 
> 
> Thanks,
> 
> Arup Rakshit
> ar@zeit.io <mailto:ar@zeit.io>
> 
> 
> 
>> On 28-Sep-2018, at 6:38 PM, Ravi Krishna <srkrishna1@aol.com 
>> <mailto:srkrishna1@aol.com>> wrote:
>>
>>
>>> Is there anyway, I can improve the sorting so that it can use the index ?
>>
>> Are you telling that why PG is not simply reading the data from the 
>> index (which is already in sorted
>> order)?
>>
> 


-- 
Adrian Klaver
adrian.klaver@aklaver.com




view thread (25+ messages)  latest in thread

Message-ID: <e8f8d7d8-044b-829f-a063-cb79f6e11d2b@aklaver.com>
Permalink:  ../e8f8d7d8-044b-829f-a063-cb79f6e11d2b@aklaver.com/
Also on:    postgresql.org/message-id/e8f8d7d8-044b-829f-a063-cb79f6e11d2b@aklaver.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: adrian.klaver@aklaver.com, ar@zeit.io, srkrishna1@aol.com
  Subject: Re: Why my query not using index to sort?
  In-Reply-To: <e8f8d7d8-044b-829f-a063-cb79f6e11d2b@aklaver.com>
  References: <1179827344.882330.1538140134266.ref@mail.yahoo.com> <1179827344.882330.1538140134266@mail.yahoo.com> <BFE70F8F-4F4A-431F-BF73-A648BF108C83@zeit.io> <e8f8d7d8-044b-829f-a063-cb79f6e11d2b@aklaver.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox