Re: [PERFORM] INDEX Performance Issue

2013-04-07 Thread Mark Davidson
Takes a little longer with the INNER join unfortunately. Takes about ~3.5 minutes, here is the query plan http://explain.depesz.com/s/EgBl. With the JOIN there might not be a match if the data does not fall within one of the areas that is selected in the IN query. So if we have data id (10) that

Re: [PERFORM] INDEX Performance Issue

2013-04-07 Thread Kevin Grittner
Greg Williamson wrote: >> Thanks for your response. I tried doing what you suggested so >> that table now has a primary key of >> ' CONSTRAINT data_area_pkey PRIMARY KEY(area_id , data_id ); ' >> and I've added the INDEX of >> 'CREATE INDEX data_area_data_id_index ON data_area USING btree (data_i

Re: [PERFORM] What happens between end of explain analyze and end of query execution ?

2013-04-07 Thread Franck Routier
Le 06/04/2013 18:27, Tom Lane a écrit : Ok, the problem definitely comes from the default_statistics_target which is obviously too high on the database. Yeah, eqjoinsel() is O(N^2) in the lengths of the MCV lists, in the worst case where there's little overlap in the list memberships. The actual

Re: [PERFORM] INDEX Performance Issue

2013-04-07 Thread Greg Williamson
> Thanks for your response. I tried doing what you suggested so that table now > has a primary key of ' CONSTRAINT data_area_pkey PRIMARY KEY(area_id , > data_id ); ' and I've added the INDEX > of 'CREATE INDEX > data_area_data_id_index ON data_area USING btree (data_id );' unfortunately > it h

Re: [PERFORM] INDEX Performance Issue

2013-04-07 Thread Mark Davidson
Hi Kevin Thanks for your response. I tried doing what you suggested so that table now has a primary key of ' CONSTRAINT data_area_pkey PRIMARY KEY(area_id , data_id ); ' and I've added the INDEX of 'CREATE INDEX data_area_data_id_index ON data_area USING btree (data_id );' unfortunately it hasn't

Re: [PERFORM] Find how much memory is postgres using

2013-04-07 Thread hubert depesz lubaczewski
On Sat, Apr 06, 2013 at 09:59:16PM -0700, Nik Tek wrote: > Could someone tell m how to measure postgres memory usage. > Is there a pg_* view to measure? http://www.depesz.com/2012/06/09/how-much-ram-is-postgresql-using/ Best regards, depesz -- The best thing about modern society is how easy it

Re: [PERFORM] Find how much memory is postgres using

2013-04-07 Thread Yetkin Öztürk
Hi, as you know 'memory usage' is smt continuously changes in time and not directly related to pg also related to your resources , you can set a specific limit if you want. 2013/4/7 Nik Tek > Hi, > > Could someone tell m how to measure postgres memory usage. > Is there a pg_* view to measure?