Re: 5.11.1 Table Partitioning Overview - "...the size of the table should exceed the physical memory.."

Поиск
Список
Период
Сортировка
От Erik Wienhold
Тема Re: 5.11.1 Table Partitioning Overview - "...the size of the table should exceed the physical memory.."
Дата
Msg-id 585296650.518007.1685474183992@office.mailbox.org
обсуждение исходный текст
Ответ на 5.11.1 Table Partitioning Overview - "...the size of the table should exceed the physical memory.."  (PG Doc comments form <noreply@postgresql.org>)
Список pgsql-docs
> 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



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

Предыдущее
От: PG Doc comments form
Дата:
Сообщение: 5.11.1 Table Partitioning Overview - "...the size of the table should exceed the physical memory.."
Следующее
От: Peter Eisentraut
Дата:
Сообщение: Re: confusing positioning of notes in connection settings