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

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Pushdown target list below gather node (WAS Re: WIP: Upper planner pathification)
Дата
Msg-id 9079.1458152734@sss.pgh.pa.us
обсуждение исходный текст
Ответ на 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)  (Robert Haas <robertmhaas@gmail.com>)
Список pgsql-hackers
Robert Haas <robertmhaas@gmail.com> writes:
> On Wed, Mar 16, 2016 at 2:02 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>> Looks pretty close.  One point is that if we do end up using a Result
>> node, then the parent GatherPath does not get charged for the Result
>> node's cpu_per_tuple overhead.  I'm not sure that that's worth changing
>> though.  It's probably better to bet that the subpath is projectable and
>> so no cost will ensue, than to bet the other way.

> I'm almost sure this way is the better bet.

Actually, we do know what will happen ... so maybe
       /*        * We always use create_projection_path here, even if the subpath is        * projection-capable, so as
toavoid modifying the subpath in place.        * It seems unlikely at present that there could be any other        *
referencesto the subpath anyway, but better safe than sorry.        */
 
+       if (!is_projection_capable_path(gpath->subpath))
+           gpath->path.total_cost += cpu_tuple_cost * gpath->subpath->rows;       gpath->subpath = (Path *)
create_projection_path(root,                                 gpath->subpath->parent,
gpath->subpath,                                 target);
 

The comment could use adjustment if you adopt that, to reference the fact
that we know create_projection_plan will get rid of the Result if not
needed.
           regards, tom lane



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

Предыдущее
От: Andres Freund
Дата:
Сообщение: Re: Performance degradation in commit ac1d794
Следующее
От: Robert Haas
Дата:
Сообщение: Re: Refactoring speculative insertion with unique indexes a little