Trivial revise for the check of parameterized partial paths

Started by Richard Guoover 3 years ago4 messageshackers
Jump to latest
#1Richard Guo
guofenglinux@gmail.com

While working on the invalid parameterized join path issue [1]/messages/by-id/CAJKUy5g2uZRrUDZJ8p-=giwcSHVUn0c9nmdxPSY0jF0Ov8VoEA@mail.gmail.com, I
noticed that we can simplify the codes for checking parameterized
partial paths in try_partial_hashjoin/mergejoin_path, with the help of
macro PATH_REQ_OUTER.

-       if (inner_path->param_info != NULL)
-       {
-               Relids          inner_paramrels =
inner_path->param_info->ppi_req_outer;
-
-               if (!bms_is_empty(inner_paramrels))
-                       return;
-       }
+       if (!bms_is_empty(PATH_REQ_OUTER(inner_path)))
+               return;

Also there is a comment there that is not correct.

* If the inner path is parameterized, the parameterization must be fully
* satisfied by the proposed outer path.

This is true for nestloop but not for hashjoin/mergejoin.

Besides, I wonder if it'd be better that we verify that the outer input
path for a partial join path should not have any parameterization
dependency.

Attached is a patch for all these changes.

[1]: /messages/by-id/CAJKUy5g2uZRrUDZJ8p-=giwcSHVUn0c9nmdxPSY0jF0Ov8VoEA@mail.gmail.com
/messages/by-id/CAJKUy5g2uZRrUDZJ8p-=giwcSHVUn0c9nmdxPSY0jF0Ov8VoEA@mail.gmail.com

Thanks
Richard

Attachments:

v1-0001-Trivial-revise-for-the-check-of-parameterized-partial-paths.patchapplication/octet-stream; name=v1-0001-Trivial-revise-for-the-check-of-parameterized-partial-paths.patchDownload+9-19
#2vignesh C
vignesh21@gmail.com
In reply to: Richard Guo (#1)
Re: Trivial revise for the check of parameterized partial paths

On Thu, 29 Jun 2023 at 08:53, Richard Guo <guofenglinux@gmail.com> wrote:

While working on the invalid parameterized join path issue [1], I
noticed that we can simplify the codes for checking parameterized
partial paths in try_partial_hashjoin/mergejoin_path, with the help of
macro PATH_REQ_OUTER.

-       if (inner_path->param_info != NULL)
-       {
-               Relids          inner_paramrels = inner_path->param_info->ppi_req_outer;
-
-               if (!bms_is_empty(inner_paramrels))
-                       return;
-       }
+       if (!bms_is_empty(PATH_REQ_OUTER(inner_path)))
+               return;

Also there is a comment there that is not correct.

* If the inner path is parameterized, the parameterization must be fully
* satisfied by the proposed outer path.

This is true for nestloop but not for hashjoin/mergejoin.

Besides, I wonder if it'd be better that we verify that the outer input
path for a partial join path should not have any parameterization
dependency.

Attached is a patch for all these changes.

I'm seeing that there has been no activity in this thread for nearly 7
months, I'm planning to close this in the current commitfest unless
someone is planning to take it forward.

Regards,
Vignesh

#3Richard Guo
guofenglinux@gmail.com
In reply to: vignesh C (#2)
Re: Trivial revise for the check of parameterized partial paths

On Sun, Jan 21, 2024 at 8:36 PM vignesh C <vignesh21@gmail.com> wrote:

I'm seeing that there has been no activity in this thread for nearly 7
months, I'm planning to close this in the current commitfest unless
someone is planning to take it forward.

This patch fixes the wrong comments in try_partial_hashjoin_path, and
also simplifies and enhances the checks for parameterized partial paths.
I think it's worth to be moved forward.

I've rebased the patch over current master, added a commit message
describing what it does, and updated the comment a little bit in the v2
patch.

Thanks
Richard

Attachments:

v2-0001-Revisions-to-the-checks-for-parameterized-partial-paths.patchapplication/octet-stream; name=v2-0001-Revisions-to-the-checks-for-parameterized-partial-paths.patchDownload+10-19
#4Richard Guo
guofenglinux@gmail.com
In reply to: Richard Guo (#3)
Re: Trivial revise for the check of parameterized partial paths

On Thu, Jan 25, 2024 at 3:21 PM Richard Guo <guofenglinux@gmail.com> wrote:

On Sun, Jan 21, 2024 at 8:36 PM vignesh C <vignesh21@gmail.com> wrote:

I'm seeing that there has been no activity in this thread for nearly 7
months, I'm planning to close this in the current commitfest unless
someone is planning to take it forward.

This patch fixes the wrong comments in try_partial_hashjoin_path, and
also simplifies and enhances the checks for parameterized partial paths.
I think it's worth to be moved forward.

I've rebased the patch over current master, added a commit message
describing what it does, and updated the comment a little bit in the v2
patch.

I've pushed this patch.

Thanks
Richard