| From: | Richard Guo <guofenglinux(at)gmail(dot)com> |
|---|---|
| To: | PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org> |
| Subject: | Fix a comment in paraminfo_get_equal_hashops |
| Date: | 2023-08-04 06:48:33 |
| Message-ID: | CAMbWs48HZGZOV85g0fx8z1qDx6NNKHexJPT2FCnKnZhxBWkd-A@mail.gmail.com |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-hackers |
As stated in [1], 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.
Thanks
Richard
| Attachment | Content-Type | Size |
|---|---|---|
| v1-0001-Fix-a-comment-in-paraminfo_get_equal_hashops.patch | application/octet-stream | 908 bytes |
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Drouvot, Bertrand | 2023-08-04 07:40:22 | Re: Synchronizing slots from primary to standby |
| Previous Message | Tatsuo Ishii | 2023-08-04 06:42:13 | Re: Using defines for protocol characters |