Re: Pushdown target list below gather node (WAS Re: WIP: Upper planner pathification)

Поиск
Список
Период
Сортировка
От Amit Kapila
Тема Re: Pushdown target list below gather node (WAS Re: WIP: Upper planner pathification)
Дата
Msg-id CAA4eK1JkU-Y+tBOZP-zngJgKVMkbytYSMsAEu7-yxR86JM+CYw@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Pushdown target list below gather node (WAS Re: WIP: Upper planner pathification)  (Robert Haas <robertmhaas@gmail.com>)
Ответы Re: Pushdown target list below gather node (WAS Re: WIP: Upper planner pathification)  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
On Wed, Mar 16, 2016 at 10:57 PM, Robert Haas <robertmhaas@gmail.com> wrote:
>
> On Wed, Mar 16, 2016 at 12:57 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> > Yeah, I was thinking about the same thing.  The comment block above
> > where you're looking would need some adjustment.
>
> OK, how about this?
>

+ * children.  Alternatively, apply_projection_to_path might have created

+ * a projection path as the subpath of a Gather node even though the

+ * subpath was projection-capable.  So, if the subpath is capable of

+ * projection or the desired tlist is the same expression-wise as the

+ * subplan's, just jam it in there.  We'll have charged for a Result that

+ * doesn't actually appear in the plan, but that's better than having a

+ * Result we don't need.

  */

- if (tlist_same_exprs(tlist, subplan->targetlist))

+ if (is_projection_capable_path(best_path->subpath) ||

+ tlist_same_exprs(tlist, subplan->targetlist))




While reading above code changes, it looks like it is assuming that subpath and subplan will always be same (as it is verifying projection capability of subpath and attaching the tlist to subplan), but I think it is possible that subpath and subplan correspond to different nodes when gating Result node is added on to top of scan plan by create_scan_plan().  I think it might be better to explain in comments, why it is safe to rely on projection capability of subpath to attach tlist to subplan.


With Regards,
Amit Kapila.
EnterpriseDB: http://www.enterprisedb.com

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

Предыдущее
От: Michael Paquier
Дата:
Сообщение: Re: IF (NOT) EXISTS in psql-completion
Следующее
От: Oskari Saarenmaa
Дата:
Сообщение: Re: Show dropped users' backends in pg_stat_activity