Re: Query taking long time

From: Vladimir Sitnikov <sitnikov(dot)vladimir(at)gmail(dot)com>
To: acanada <acanada(at)cnio(dot)es>
Cc: Venkata Balaji Nagothi <vbnpgc(at)gmail(dot)com>, pgsql-performance(at)postgresql(dot)org
Subject: Re: Query taking long time
Date: 2014-03-03 17:17:40
Message-ID: CAB=Je-Ft3H5Vt7qBXcD0nwwjk-iTNM0A44zFbP3ezp7Dg0a59Q@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

> I have simplified the query and added the last advise that you told me:
>
> Query:
>
> explain analyze select * from (select * from
entity_compounddict2document where name='ranitidine') as a order by
a.hepval;
>
Do you need full result?

If you need just top-n rows, then index on
entity_compounddict2document(name, a.hepval) might help.

Regards,
Vladimir Sitnikov

In response to

Browse pgsql-performance by date

  From Date Subject
Next Message Damon Snyder 2014-03-03 17:55:41 Re: Help with optimizing a query over hierarchical data
Previous Message acanada 2014-03-03 10:17:44 Re: Query taking long time