Re: speeding up planning with partitions

From: Amit Langote <Langote_Amit_f8(at)lab(dot)ntt(dot)co(dot)jp>
To: David Rowley <david(dot)rowley(at)2ndquadrant(dot)com>
Cc: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>, "Imai, Yoshikazu" <imai(dot)yoshikazu(at)jp(dot)fujitsu(dot)com>, Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: speeding up planning with partitions
Date: 2018-11-14 11:01:16
Message-ID: 19a2711b-5b5b-3d71-3cb4-ccece7cc2a5f@lab.ntt.co.jp
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 2018/11/14 19:28, Amit Langote wrote:
> Attached updated patches. Significant revisions are as follows (note that
> I reversed the order of 0001 and 0002):
>
> v6-0001-Overhaul-inheritance-update-delete-planning.patch
>
> The major changes is fixing the problem above.
>
> v6-0002-Store-inheritance-root-parent-index-in-otherrel-s.patch
>
> No change.
>
> v6-0003-Lazy-creation-of-RTEs-for-inheritance-children.patch
>
> Made inheritance expansion a separate step of make_one_rel whereas
> previously it would be invoked at the beginning of set_append_rel_size.
> Now, it runs just before set_base_rel_sizes. The same step also
> recursively expands (and performs pruning for) any child partitioned
> tables that were added by the expansion of partitioned tables originally
> mentioned in the query. With this change, we don't need to worry about
> the range table changing as set_base_rel_size is executing, which could
> lead to problems.
>
> v6-0004-Move-append-expansion-code-into-its-own-file.patch
> v6-0005-Teach-planner-to-only-process-unpruned-partitions.patch
> v6-0006-Do-not-lock-all-partitions-at-the-beginning.patch

This went out sooner than it should have. I hadn't waited for make
check-world to finish which showed that a file_fdw test exercising
inheritance crashed with 0001 patch due to a bogus Assert.

Fixed it in the attached version.

Thanks,
Amit

Attachment Content-Type Size
v7-0001-Overhaul-inheritance-update-delete-planning.patch text/plain 51.5 KB
v7-0002-Store-inheritance-root-parent-index-in-otherrel-s.patch text/plain 2.5 KB
v7-0003-Lazy-creation-of-RTEs-for-inheritance-children.patch text/plain 85.4 KB
v7-0004-Move-append-expansion-code-into-its-own-file.patch text/plain 112.3 KB
v7-0005-Teach-planner-to-only-process-unpruned-partitions.patch text/plain 7.2 KB
v7-0006-Do-not-lock-all-partitions-at-the-beginning.patch text/plain 1.2 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Joshua Yanovski 2018-11-14 11:52:27 Re: In-place updates and serializable transactions
Previous Message Surafel Temesgen 2018-11-14 10:48:36 Re: [Todo item] Add entry creation timestamp column to pg_stat_replication