Re: Schemas vs partitioning vs multiple databases for archiving

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Craig Ringer <ringerc(at)ringerc(dot)id(dot)au>
Cc: Bartel Viljoen <bartel(at)ncc(dot)co(dot)za>, "'pgsql-general(at)postgresql(dot)org'" <pgsql-general(at)postgresql(dot)org>
Subject: Re: Schemas vs partitioning vs multiple databases for archiving
Date: 2012-08-18 17:22:12
Message-ID: 25387.1345310532@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Craig Ringer <ringerc(at)ringerc(dot)id(dot)au> writes:
> On 08/18/2012 04:05 PM, Bartel Viljoen wrote:
>> My current application make use of partitioning by creating a new child
>> table which holds transaction records for every month. Ive notice that
>> after a couple of months depending on the hardware at some of our
>> clients the inserts become very slow.

> Look into the cause of that before trying to fix it. Why do they slow
> down? "Memory" is unlikely to be the explanation, unless there's more
> going on than you're saying, like a big trigger function.

If he's getting into the hundreds of partitions, I could believe that
memory would be a problem for both planning and execution. Otherwise
this sounds more like a table or index bloat problem (are there a lot of
updates per row?).

If it is too-many-partitions, my recommendation would be to question
whether partitioning is useful at all. The main thing it is really good
for is dropping old partitions cheaply ... so if he's not going to do
that, I wonder what it's buying for him.

regards, tom lane

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Jeff Janes 2012-08-18 19:16:19 Re: Schemas vs partitioning vs multiple databases for archiving
Previous Message Tom Lane 2012-08-18 17:16:34 Re: Fwd: PSQL Help from your biggest fan