Re: [PoC] Reducing planning time when tables have many partitions - Mailing list pgsql-hackers

From Dmitry Dolgov
Subject Re: [PoC] Reducing planning time when tables have many partitions
Date
Msg-id aagyzk7dfhalljinxqomatx5r4ilq4gyq5jq6cqppnls5owdbb@4fcw5tpagcnc
Whole thread Raw
In response to Re: [PoC] Reducing planning time when tables have many partitions  (Yuya Watari <watari.yuya@gmail.com>)
List pgsql-hackers
> On Tue, Oct 15, 2024 at 12:20:04PM GMT, Yuya Watari wrote:
>
> The previous patches do not apply to the current master, so I have
> attached the rebased version.

Thanks for keeping it up to date.

> v25-0001
> This patch is one of the main parts of my optimization. Traditionally,
> EquivalenceClass has both parent and child members. However, this
> leads to high iteration costs when there are many child partitions. In
> v25-0001, EquivalenceClasses no longer have child members. If we need
> to iterate over child EquivalenceMembers, we use the
> EquivalenceChildMemberIterator and access the children through the
> iterator. For more details, see [1] (note that there are some design
> changes from [1]).

The referenced email containst some benchmark results. But shouldn't the
benchmark be repeated after those design changes you're talking about?

Few random notes after quickly looking through the first patch:

* There are patterns like this scattered around, it looks somewhat confusing:

    +   /* See the comments in get_eclass_for_sort_expr() to see how this works. */
    +   top_parent_rel_relids = find_relids_top_parents(root, rel->relids);

  It's not immediately clear which part of get_eclass_for_sort_expr is
  relevant, or one have to read the whole function first. Probably better to
  omit the superficial commentary on the call site, and instead expand the
  commentary for the find_relids_top_parents itself?

* The patch series features likely/unlikely since v20, but don't see any
  discussion about that. Did you notice any visible boost from that? I wonder
  how necessary that is.



pgsql-hackers by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: Statistics Import and Export
Next
From: Robert Haas
Date:
Subject: Re: Consider pipeline implicit transaction as a transaction block