Re: Missing MaterialPath support in reparameterize_path_by_child
Richard Guo <guofenglinux@gmail.com>
From: Richard Guo <guofenglinux@gmail.com>
To: Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>
Cc: Tom Lane <tgl@sss.pgh.pa.us>, pgsql-hackers@lists.postgresql.org
Date: 2022-12-02T13:16:07Z
Lists: pgsql-hackers
On Fri, Dec 2, 2022 at 8:49 PM Richard Guo <guofenglinux@gmail.com> wrote:
> BTW, the code changes I'm using:
>
> --- a/src/backend/optimizer/util/pathnode.c
> +++ b/src/backend/optimizer/util/pathnode.c
> @@ -3979,6 +3979,17 @@ reparameterize_path(PlannerInfo *root, Path *path,
> apath->path.parallel_aware,
> -1);
> }
> + case T_Material:
> + {
> + MaterialPath *matpath = (MaterialPath *) path;
> + Path *spath = matpath->subpath;
> +
> + spath = reparameterize_path(root, spath,
> + required_outer,
> + loop_count);
> +
> + return (Path *) create_material_path(rel, spath);
> + }
>
BTW, the subpath needs to be checked if it is null after being
reparameterized, since it might be a path type that is not supported
yet.
--- a/src/backend/optimizer/util/pathnode.c
+++ b/src/backend/optimizer/util/pathnode.c
@@ -3979,6 +3979,19 @@ reparameterize_path(PlannerInfo *root, Path *path,
apath->path.parallel_aware,
-1);
}
+ case T_Material:
+ {
+ MaterialPath *matpath = (MaterialPath *) path;
+ Path *spath = matpath->subpath;
+
+ spath = reparameterize_path(root, spath,
+ required_outer,
+ loop_count);
+ if (spath == NULL)
+ return NULL;
+
+ return (Path *) create_material_path(rel, spath);
+ }
Thanks
Richard
Commits
-
Add missing MaterialPath support in reparameterize_path[_by_child].
- 6eb2f0ed4cd5 16.0 landed
-
Fix generate_partitionwise_join_paths() to tolerate failure.
- fe12f2f8fa60 16.0 landed
- ec3daeec316f 14.7 landed
- bf8fd64ff5e6 15.2 landed
- 4ebca555cf23 13.10 landed
- 2df073313934 11.19 landed
- 1ff549e844cc 12.14 landed