Re: Question about some changes in 11.3

From: Amit Langote <Langote_Amit_f8(at)lab(dot)ntt(dot)co(dot)jp>
To: Mat Arye <mat(at)timescale(dot)com>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Question about some changes in 11.3
Date: 2019-05-29 01:58:45
Message-ID: 7f478763-93d7-8912-14f1-32d02a2b9bb3@lab.ntt.co.jp
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi Mat,

On 2019/05/25 6:05, Mat Arye wrote:
> Hi,
>
> 11.3 included some change to partition table planning. Namely
> commit 925f46f ("Fix handling of targetlist SRFs when scan/join relation is
> known empty.") seems to redo all paths for partitioned tables
> in apply_scanjoin_target_to_paths. It clears the paths in:
>
> ```
> if (rel_is_partitioned)
> rel->pathlist = NIL
> ```
>
> Then the code rebuild the paths. However, the rebuilt append path never
> gets the
> set_rel_pathlist_hook called. Thus, the work that hook did previously gets
> thrown away and the rebuilt append path can never be influenced by this
> hook.

By dropping the old paths like done here, the core code is simply
forgetting that set_rel_pathlist_hook may have editorialized over them,
which seems like an oversight of that commit.

Your proposal to call set_rel_pathlist_hook() after
add_paths_to_append_rel() to rebuild the Append paths sounds fine to me.

Thanks,
Amit

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Kohei KaiGai 2019-05-29 03:13:42 How to know referenced sub-fields of a composite type?
Previous Message Amit Langote 2019-05-29 00:51:05 Re: PG 12 draft release notes