Received: from maia.hub.org (maia-2.hub.org [200.46.204.251]) by mail.postgresql.org (Postfix) with ESMTP id 425A1B325B4 for ; Tue, 8 Nov 2011 08:40:34 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.251]) (amavisd-maia, port 10024) with ESMTP id 08410-07 for ; Tue, 8 Nov 2011 12:40:28 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.8.0-rc2 Received: from elizabeth.gransy.com (ns2.gransy.com [89.187.132.100]) by mail.postgresql.org (Postfix) with ESMTP id 63BF9B325B5 for ; Tue, 8 Nov 2011 08:40:27 -0400 (AST) Received: from sq.gransy.com (localhost [127.0.0.1]) by elizabeth.gransy.com (Postfix) with ESMTP id DC8BE15E4318; Tue, 8 Nov 2011 13:40:25 +0100 (CET) Received: from 85.162.117.36 (SquirrelMail authenticated user tv@fuzzy.cz) by sq.gransy.com with HTTP; Tue, 8 Nov 2011 13:40:25 +0100 Message-ID: <1f1660cbba9479276aa885f027cbbf0d.squirrel@sq.gransy.com> In-Reply-To: References: <4EAFC29A.40509@engene.se> <24830.1320154980@sss.pgh.pa.us> <4EB2ACEF.8090305@gmx.at> <65a8332e0128eda27f0345da80946dc6.squirrel@sq.gransy.com> <4EB2F49F.3080903@gmx.at> Date: Tue, 8 Nov 2011 13:40:25 +0100 Subject: Re: Performance Problem with postgresql 9.03, 8GB RAM,Quadcore Processor Server--Need help!!!!!!! From: "Tomas Vondra" To: "Mohamed Hashim" Cc: "Tomas Vondra" , "Mario Weilguni" , pgsql-performance@postgresql.org User-Agent: SquirrelMail/1.4.21 MIME-Version: 1.0 Content-Type: text/plain;charset=utf-8 Content-Transfer-Encoding: 8bit X-Priority: 3 (Normal) Importance: Normal X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.9 tagged_above=-10 required=5 tests=BAYES_00=-1.9 X-Spam-Level: X-Archive-Number: 201111/115 X-Sequence-Number: 45626 On 8 Listopad 2011, 13:15, Mohamed Hashim wrote: > Hi Sam,Tomas > > In my first post i have mentioned all how much shared (shared buffers, > effective cache size, work mem, etc.) and my OS and hardware information > and what are the basic settings i have changed Sorry, I've missed that first message - the archive did not list it for some reason. > and regarding Explain analyze i gave one sample query because if i tune > that particular table which has records almost 16crore i thought my > problem > will solve... OK, so the problem is either the WHERE conditions referencing the array column, or a bug in 9.0.x. Can't help you with the upgrade issue, but using an array like this is a bad design and will cause you all sorts of problems - why are you not using regular columns, anyway? I see you usually reference source_detail[1] - what is the expected selectivity of this condition? What portion of the table matches it? How many possible values are there? And it does not make sense to me to partition by date when you're not querying the data by date. Try this (one by one): 1) CREATE INDEX src_idx ON stk_source(source_detail[1]) for each partition 2) add a regular column source_detail_val with the value of source_detail[1] and create an index on it 3) repartition the table by source_detail[1] instead of date Tomas