Re: [PERFORM] Slow query

2014-03-06 Thread David Johnston
Bikram Kesari Naik wrote > Hi David, > > We have indexes on all the columns which are used in the where clause and > these tables are linked by foreign key constraint. > > > Thanks, > Bikram > > -Original Message- > From: > pgsql-performance-owner@ > [mailto: > pgsql-performance-ow

Re: [PERFORM] Slow query

2014-03-06 Thread Bikram Kesari Naik
Hi David, We have indexes on all the columns which are used in the where clause and these tables are linked by foreign key constraint. Thanks, Bikram -Original Message- From: pgsql-performance-ow...@postgresql.org [mailto:pgsql-performance-ow...@postgresql.org] On Behalf Of David John

Re: [PERFORM] Slow query

2014-03-06 Thread David Johnston
Bikram Kesari Naik wrote > Hi, > > I have a view which joins multiple tables to give me a result. It takes > more than a minute to give me the result on psql prompt when I select all > the data from that view. > The single CPU which is used to run this query is utilized 100%.Even if I > fire a c

Re: [PERFORM] Query taking long time

2014-03-06 Thread acanada
Hello Mat, Setting enable_bitmapscan to off doesn't really helps. It gets worse... x=> SET enable_bitmapscan=off; SET x=> explain analyze select * from (select * from entity2document2 where name='ranitidine' ) as a order by a.hepval;

Re: [PERFORM] Query taking long time

2014-03-06 Thread desmodemone
Il 05/mar/2014 00:36 "Venkata Balaji Nagothi" ha scritto: > > 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 i