Re: [PERFORM] Query taking long time

2014-03-04 Thread Venkata Balaji Nagothi
After looking at the distinct values, yes the composite Index on "name" and "hepval" is not recommended. That would worsen - its expected. We need to look for other possible work around. Please drop off the above Index. Let me see if i can drill further into this. Meanwhile - can you help us know

Re: [PERFORM] Help with optimizing a query over hierarchical data

2014-03-04 Thread Damon Snyder
Hi Claudio, Thanks for the help! Damon On Mon, Mar 3, 2014 at 8:20 PM, Claudio Freire wrote: > On Mon, Mar 3, 2014 at 10:12 PM, Damon Snyder > wrote: > > > >> Um... I think your problem is a misuse of CTE. Your CTE is building an > > intermediate of several thousands of rows only to select a d

Re: [PERFORM] Query taking long time

2014-03-04 Thread acanada
Hello, I don't know if this helps to figure out what is the problem but after adding the multicolumn index on name and hepval, the performance is even worse (¿?). Ten times worse... explain analyze select * from (select * from entity_compounddict2document where name='progesterone') as a orde

Re: [PERFORM] Query taking long time

2014-03-04 Thread acanada
Hello! The table doesn't go through high inserts so I'm taking into account your "CLUSTER" advise. Thanks. I'm afraid that I cannot drop the indexes that don't have scans hits because they will have scans and hits very soon Duplicated values for this table are: tablename | attname