pg.ddx.io  pgsql-docs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Erik Wienhold <ewie@ewie.name>
To: vasiliauskas.mg@gmail.com
To: pgsql-docs@lists.postgresql.org
Subject: Re: 5.11.1 Table Partitioning Overview - "...the size of the table should exceed the physical memory.."
Date: Tue, 30 May 2023 21:16:23 +0200 (CEST)
Message-ID: <585296650.518007.1685474183992@office.mailbox.org> (raw)
In-Reply-To: <168542321808.1230020.11749247868403452374@wrigleys.postgresql.org>
References: <168542321808.1230020.11749247868403452374@wrigleys.postgresql.org>

> On 30/05/2023 07:06 CEST PG Doc comments form <noreply@postgresql.org> wrote:
>
> The following documentation comment has been logged on the website:
>
> Page: https://www.postgresql.org/docs/15/ddl-partitioning.html
> Description:
>
> Is this rule of thumb a typo?
>
> "The exact point at which a table will benefit from partitioning depends on
> the application, although a rule of thumb is that the size of the table
> should exceed the physical memory of the database server."
>
> I believe it should say the "a rule of thumb is that the size of the table
> should NOT exceed the physical memory of the database server."

That rule of thumb is correct (or at least not wrong).  The reasoning behind it
is that table partitioning provides a benefit if individual partitions fit into
physical memory and queries target just a few partitions instead of the entire
table.  Subsequent queries will benefit if the necessary tables have already
been loaded into memory.  If a table does not fit into memory, Postgres will
have to constantly swap out memory.  Also work_mem may be exceeded sooner with
larger tables and Postgres has to eventually write temporary files to disk to
store intermediate results, e.g. for sorting and hashing.

Physical memory means RAM, not disk, if that's your issue here.

--
Erik





view thread (2+ messages)

Message-ID: <585296650.518007.1685474183992@office.mailbox.org>
Permalink:  ../585296650.518007.1685474183992@office.mailbox.org/
Also on:    postgresql.org/message-id/585296650.518007.1685474183992@office.mailbox.org

 · 

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-docs@postgresql.org
  Cc: ewie@ewie.name, vasiliauskas.mg@gmail.com, pgsql-docs@lists.postgresql.org
  Subject: Re: 5.11.1 Table Partitioning Overview - "...the size of the table should exceed the physical memory.."
  In-Reply-To: <585296650.518007.1685474183992@office.mailbox.org>

* 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