Re: path->param_info only set for lateral?

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: path->param_info only set for lateral?
Дата
Msg-id 2834988.1687143457@sss.pgh.pa.us
обсуждение исходный текст
Ответ на path->param_info only set for lateral?  (James Coleman <jtc331@gmail.com>)
Ответы Re: path->param_info only set for lateral?  (James Coleman <jtc331@gmail.com>)
Список pgsql-hackers
James Coleman <jtc331@gmail.com> writes:
> Over in "Parallelize correlated subqueries that execute within each
> worker" [1} Richard Guo found a bug in the current version of my patch
> in that thread. While debugging that issue I've been wondering why
> Path's param_info field seems to be NULL unless there is a LATERAL
> reference even though there may be non-lateral outer params
> referenced.

Per pathnodes.h:

 * "param_info", if not NULL, links to a ParamPathInfo that identifies outer
 * relation(s) that provide parameter values to each scan of this path.
 * That means this path can only be joined to those rels by means of nestloop
 * joins with this path on the inside.  ...

We're only interested in this for params that are coming from other
relations of the same query level, so that they affect join order and
join algorithm choices.  Params coming down from outer query levels
are much like EXTERN params to the planner: they are pseudoconstants
for any one execution of the current query level.

This isn't just LATERAL stuff; it's also intentionally-generated
nestloop-with-inner-indexscan-cases.  But it's not outer-level Params.
Even though those are also PARAM_EXEC Params, they are fundamentally
different animals for the planner's purposes.

            regards, tom lane



В списке pgsql-hackers по дате отправления:

Предыдущее
От: jian he
Дата:
Сообщение: Re: Deleting prepared statements from libpq.
Следующее
От: Amit Kapila
Дата:
Сообщение: Re: Subscription statistics are not dropped at DROP SUBSCRIPTION in some cases