Re: Query taking long time - Mailing list pgsql-performance

From Vladimir Sitnikov
Subject Re: Query taking long time
Date
Msg-id CAB=Je-Ft3H5Vt7qBXcD0nwwjk-iTNM0A44zFbP3ezp7Dg0a59Q@mail.gmail.com
Whole thread Raw
In response to Re: Query taking long time  ("acanada" <acanada@cnio.es>)
List 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

pgsql-performance by date:

Previous
From: "acanada"
Date:
Subject: Re: Query taking long time
Next
From: Damon Snyder
Date:
Subject: Re: Help with optimizing a query over hierarchical data