Re: Why my query not using index to sort?
Re: Why my query not using index to sort?
От:
Ravi Krishna <srkrishna1@aol.com>
Дата:
> 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)?
Re: Why my query not using index to sort?
От:
Arup Rakshit <ar@zeit.io>
Дата:
Hi Ravi,
Yes you are right. It seems it is doing sorting in memory by name. But I have `name` column in index.
On 28-Sep-2018, at 6:38 PM, Ravi Krishna <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)?
Re: Why my query not using index to sort?
От:
Adrian Klaver <adrian.klaver@aklaver.com>
Дата:
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 > > > >> On 28-Sep-2018, at 6:38 PM, Ravi Krishna > > 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