Re: using CustomScan to inject nodes into the plan

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: using CustomScan to inject nodes into the plan
Дата
Msg-id 10102.1426107223@sss.pgh.pa.us
обсуждение исходный текст
Ответ на using CustomScan to inject nodes into the plan  (Tomas Vondra <tomas.vondra@2ndquadrant.com>)
Ответы Re: using CustomScan to inject nodes into the plan  (Tomas Vondra <tomas.vondra@2ndquadrant.com>)
Список pgsql-hackers
Tomas Vondra <tomas.vondra@2ndquadrant.com> writes:
> I've been experimenting with using CustomScan to inject nodes into the
> plan - I'm experimenting a bit, and this seemed like a nice way to do
> that in an extension, outside the tree.

> Sadly set_rel_pathlist_hook is not flexible enough, because it only
> allows overriding paths for base relations, while I'd like to inject
> nodes above joins, for example, so instead of

It's Custom*Scan*, not Custom-anything-you-want.  It's only supposed
to exist at the bottom level of the plan tree, and that's why it does
not have fields that would allow using it somewhere else.  Quite aside
from the scanrelid thing, haven't you noticed that it lacks any link to
child plan nodes?

I'm not terribly on board with this whole concept of adding plan nodes
from extensions; I do not believe that that approach will ever lead to
anything except horrid kluges, bad planning decisions, and requests for
ever-more-outre hooks to shift the kluginess somewhere else.  But as
Robert says, the custom join thing is more likely to be usable for this,
and it would be interesting to hear just how bad the impedance mismatch
is if you try that.
        regards, tom lane



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

Предыдущее
От: Jim Nasby
Дата:
Сообщение: Re: proposal: searching in array function - array_position
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Strange assertion using VACOPT_FREEZE in vacuum.c