From: Tom Lane <tgl@sss.pgh.pa.us>
To: Mladen Gogala <gogala.mladen@gmail.com>
Cc: pgsql-general@lists.postgresql.org
Subject: Re: Assistance with an out of shared memory error
Date: Sat, 15 Jan 2022 19:41:12 -0500
Message-ID: <3621619.1642293672@sss.pgh.pa.us> (raw)
In-Reply-To: <434dde00-59d2-64c1-ebf0-bc2b8765b337@gmail.com>
References: <CA+MVzH2N65_JzJyC4p8C4EC9k29C=VAi9eAnZdWWFV-co4c0+w@mail.gmail.com>
<3297903.1642116955@sss.pgh.pa.us>
<434dde00-59d2-64c1-ebf0-bc2b8765b337@gmail.com>
Mladen Gogala <gogala.mladen@gmail.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
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 from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-general@postgresql.org
Cc: tgl@sss.pgh.pa.us, gogala.mladen@gmail.com
Subject: Re: Assistance with an out of shared memory error
In-Reply-To: <3621619.1642293672@sss.pgh.pa.us>
References: <CA+MVzH2N65_JzJyC4p8C4EC9k29C=VAi9eAnZdWWFV-co4c0+w@mail.gmail.com> <3297903.1642116955@sss.pgh.pa.us> <434dde00-59d2-64c1-ebf0-bc2b8765b337@gmail.com> <3621619.1642293672@sss.pgh.pa.us>
* 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