Re: Assistance with an out of shared memory error

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Mladen Gogala <gogala(dot)mladen(at)gmail(dot)com>
Cc: pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Re: Assistance with an out of shared memory error
Date: 2022-01-16 00:41:12
Message-ID: 3621619.1642293672@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Mladen Gogala <gogala(dot)mladen(at)gmail(dot)com> writes:
> On 1/13/22 18:35, Tom Lane wrote:
>> .. or else reduce the number of partitions you're using. (People
>> frequently seem to think that more partitions are free. That is
>> extremely not true. I generally think that if you're using more
>> than a few dozen partitions per table, you are making a mistake.)

> Interesting. What resources do partitions consume?

Locks, planning time, execution time, cache-management overhead.
To the extent that all of your queries against a table can be
"pruned" to only touch a few partitions, you might come out ahead on
execution time; but I think few workloads are completely stylized
like that.

The poster-child use case for partitions is where you can make
them fit a recurring bulk-deletion scenario; for instance, once
a month you want to drop the oldest month's worth of data.
If you've got terabytes of data then there's also something to
be said for being able to split up vacuuming and other background
overhead. But I think a lot of people are way too eager to
apply partitioning where it doesn't fit, or to overuse it even
where it does fit.

regards, tom lane

In response to

Browse pgsql-general by date

  From Date Subject
Next Message David G. Johnston 2022-01-16 01:02:51 Re: WAL Archiving and base backup
Previous Message Adrian Klaver 2022-01-16 00:31:42 Re: WAL Archiving and base backup