Re: postgresql 12 runs out of memory when updating a partitioned table with subquery

From: David Rowley <dgrowleyml(at)gmail(dot)com>
To: Max Vikharev <bm(dot)kinder(at)gmail(dot)com>
Cc: PostgreSQL mailing lists <pgsql-bugs(at)lists(dot)postgresql(dot)org>
Subject: Re: postgresql 12 runs out of memory when updating a partitioned table with subquery
Date: 2020-07-12 21:44:10
Message-ID: CAApHDvot4+RtZFMsBEc4JtMW4xd17fQOS-d_qmJ4Cm37jbFYog@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On Mon, 13 Jul 2020 at 00:05, Max Vikharev <bm(dot)kinder(at)gmail(dot)com> wrote:
> It is very sad that postgresql can be killed with such a small amount of partitions.
> Looks like partitioning by project is not an option for my case (query is generated by Django ORM, there are many others).
> I'll use indexing.

FWIW, this is part of the planner that there is work-in-progress to
improve. However, that's not going to appear until at least PG14.

The reason that PG12's planner is so slow and uses so much memory here
is that it's planning that subquery once for each partition.

David

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message PG Bug reporting form 2020-07-13 12:59:13 BUG #16536: Segfault with partition-wise joins
Previous Message Etsuro Fujita 2020-07-12 12:55:31 Re: BUG #16500: SQL Abend. select multi_key_columns_range_partition_table