Re: High CPU usage after partitioning

Поиск
Список
Период
Сортировка
От Merlin Moncure
Тема Re: High CPU usage after partitioning
Дата
Msg-id CAHyXU0waVJHhQT6s5z0sCKZ5VmR0f5Ww7BhVDJsFc_u6gZSDJQ@mail.gmail.com
обсуждение исходный текст
Ответ на High CPU usage after partitioning  (rudi <rudolone@gmail.com>)
Список pgsql-performance
On Mon, Jan 21, 2013 at 9:05 AM, rudi <rudolone@gmail.com> 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?

First thing that jumps to mind is you have some seq-scan heavy plans
that were not seq-scan before.  Could be due to query fooling CE
mechanism or some other CE (probably fixable issue).  To diagnose we
need to see some explain analyze plans of queries that are using
higher than expected cpu usage.

Second possible cause is trigger overhead from inserts.  Not likely to
cause so much of a jump, but if this is the issue suggested
optimization path is to insert directly to the partition.

merlin


В списке pgsql-performance по дате отправления:

Предыдущее
От: Albe Laurenz
Дата:
Сообщение: Re: Analyze and default_statistics_target
Следующее
От: "Kevin Grittner"
Дата:
Сообщение: Re: High CPU usage after partitioning