Re: Question about some changes in 11.3 - Mailing list pgsql-hackers

From Amit Langote
Subject Re: Question about some changes in 11.3
Date
Msg-id 7f478763-93d7-8912-14f1-32d02a2b9bb3@lab.ntt.co.jp
Whole thread Raw
In response to Question about some changes in 11.3  (Mat Arye <mat@timescale.com>)
List 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




pgsql-hackers by date:

Previous
From: Amit Langote
Date:
Subject: Re: PG 12 draft release notes
Next
From: Kohei KaiGai
Date:
Subject: How to know referenced sub-fields of a composite type?