Fix a comment in paraminfo_get_equal_hashops

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

As stated in [1]/messages/by-id/CAMbWs49dEHRPe8poM_K39r2uOsaOZcg+Y0B5a8tF7vW3uVR3mw@mail.gmail.com, there is a typo in the comment in
paraminfo_get_equal_hashops.

foreach(lc, innerrel->lateral_vars)
{
Node *expr = (Node *) lfirst(lc);
TypeCacheEntry *typentry;

/* Reject if there are any volatile functions in PHVs */
if (contain_volatile_functions(expr))
{
list_free(*operators);
list_free(*param_exprs);
return false;
}

The expressions in RelOptInfo.lateral_vars are not necessarily from
PHVs. For instance

explain (costs off)
select * from t t1 join
lateral (select * from t t2 where t1.a = t2.a offset 0) on true;
QUERY PLAN
----------------------------------
Nested Loop
-> Seq Scan on t t1
-> Memoize
Cache Key: t1.a
Cache Mode: binary
-> Seq Scan on t t2
Filter: (t1.a = a)
(7 rows)

The lateral Var 't1.a' comes from the lateral subquery.

So attach a trivial patch to fix that.

[1]: /messages/by-id/CAMbWs49dEHRPe8poM_K39r2uOsaOZcg+Y0B5a8tF7vW3uVR3mw@mail.gmail.com
/messages/by-id/CAMbWs49dEHRPe8poM_K39r2uOsaOZcg+Y0B5a8tF7vW3uVR3mw@mail.gmail.com

Thanks
Richard

Attachments:

v1-0001-Fix-a-comment-in-paraminfo_get_equal_hashops.patchapplication/octet-stream; name=v1-0001-Fix-a-comment-in-paraminfo_get_equal_hashops.patchDownload+1-2
#2David Rowley
dgrowleyml@gmail.com
In reply to: Richard Guo (#1)
Re: Fix a comment in paraminfo_get_equal_hashops

On Fri, 4 Aug 2023 at 18:48, Richard Guo <guofenglinux@gmail.com> wrote:

As stated in [1], there is a typo in the comment in
paraminfo_get_equal_hashops.

[1] /messages/by-id/CAMbWs49dEHRPe8poM_K39r2uOsaOZcg+Y0B5a8tF7vW3uVR3mw@mail.gmail.com

Thanks. Pushed.

David