pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Andrew Dunstan <andrew@dunslane.net>
To: rudi <rudolone@gmail.com>
Cc: pgsql-performance@postgresql.org
Subject: Re: High CPU usage after partitioning
Date: Mon, 21 Jan 2013 19:41:29 -0500
Message-ID: <50FDE039.3030601@dunslane.net> (raw)
In-Reply-To: <CAMxPiKHyJkMAqO62wH6aVzpvpfxhHd_P4pZZRgTCAdxLAnLeCw@mail.gmail.com>
References: <CAMxPiKHyJkMAqO62wH6aVzpvpfxhHd_P4pZZRgTCAdxLAnLeCw@mail.gmail.com>
List-Unsubscribe:  <mailto:majordomo@postgresql.org?body=unsub%20pgsql-performance>


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



view thread (11+ messages)  latest in thread

Message-ID: <50FDE039.3030601@dunslane.net>
Permalink:  ../50FDE039.3030601@dunslane.net/
Also on:    postgresql.org/message-id/50FDE039.3030601@dunslane.net

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-performance@postgresql.org
  Cc: andrew@dunslane.net, rudolone@gmail.com
  Subject: Re: High CPU usage after partitioning
  In-Reply-To: <50FDE039.3030601@dunslane.net>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox