Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TxRvx-0005ua-US for pgsql-performance@arkaria.postgresql.org; Tue, 22 Jan 2013 00:41:50 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.72) (envelope-from ) id 1TxRvx-0004g6-D6 for pgsql-performance@arkaria.postgresql.org; Tue, 22 Jan 2013 00:41:49 +0000 Received: from magus.postgresql.org ([87.238.57.229]) by malur.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TxRvw-0004fN-C1 for pgsql-performance@postgresql.org; Tue, 22 Jan 2013 00:41:48 +0000 Received: from relay4-d.mail.gandi.net ([217.70.183.196]) by magus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TxRvt-0002F2-6l for pgsql-performance@postgresql.org; Tue, 22 Jan 2013 00:41:48 +0000 X-Originating-IP: 217.70.178.133 Received: from mfilter3-d.gandi.net (mfilter3-d.gandi.net [217.70.178.133]) by relay4-d.mail.gandi.net (Postfix) with ESMTP id 49B53172067; Tue, 22 Jan 2013 01:41:33 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at mfilter3-d.gandi.net Received: from relay4-d.mail.gandi.net ([217.70.183.196]) by mfilter3-d.gandi.net (mfilter3-d.gandi.net [10.0.15.180]) (amavisd-new, port 10024) with ESMTP id OxhJBrohBLlL; Tue, 22 Jan 2013 01:41:32 +0100 (CET) X-Originating-IP: 98.27.58.255 Received: from [192.168.10.146] (cpe-098-027-058-255.nc.res.rr.com [98.27.58.255]) (Authenticated sender: adsend@dunslane.net) by relay4-d.mail.gandi.net (Postfix) with ESMTPSA id 8297F172097; Tue, 22 Jan 2013 01:41:31 +0100 (CET) Message-ID: <50FDE039.3030601@dunslane.net> Date: Mon, 21 Jan 2013 19:41:29 -0500 From: Andrew Dunstan User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:15.0) Gecko/20120827 Thunderbird/15.0 MIME-Version: 1.0 To: rudi CC: pgsql-performance@postgresql.org Subject: Re: High CPU usage after partitioning References: In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Pg-Spam-Score: -2.6 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-performance Precedence: bulk Sender: pgsql-performance-owner@postgresql.org On 01/21/2013 10:05 AM, rudi wrote: > Hello, > > I'm running postgresl 9.0. After partitioning a big table, CPU usage > raised from average 5-10% to average 70-80%. > > - the table contains about 20.000.000 rows > - partitions are selected using a trigger, based on an indexed field, > a date (IF date_taken >= x AND date_taken < y) > - I created 5 partitions, the 2012 one now contains most of the rows. > The 2013 partition is the "live" partition, mostly insert, a few > select based on the above indexed field. The 2013, 2014, 2015 > partitions are empty > - constraint execution is on. > I have 2 weeks CPU usage reports and the pattern definately changed > after I made the partitions. Any idea? > > Well, the first question that comes to my mind is whether it's the inserts that are causing the load or the reads. If it's the inserts then you should show us the whole trigger. Does it by any chance use 'execute'? cheers andrew -- Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-performance