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