Re: [v9.5] Custom Plan API

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Kouhei Kaigai <kaigai(at)ak(dot)jp(dot)nec(dot)com>
Cc: Kohei KaiGai <kaigai(at)kaigai(dot)gr(dot)jp>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>, Shigeru Hanada <shigeru(dot)hanada(at)gmail(dot)com>, Simon Riggs <simon(at)2ndquadrant(dot)com>, Stephen Frost <sfrost(at)snowman(dot)net>, Andres Freund <andres(at)2ndquadrant(dot)com>, PgHacker <pgsql-hackers(at)postgresql(dot)org>, Jim Mlodgenski <jimmy76(at)gmail(dot)com>, Peter Eisentraut <peter_e(at)gmx(dot)net>
Subject: Re: [v9.5] Custom Plan API
Date: 2014-09-11 20:07:45
Message-ID: CA+TgmoYJ1A9burd6basr5MEV+sPwCeMco97ZBj+urdSnT01+Zg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, Sep 11, 2014 at 11:24 AM, Kouhei Kaigai <kaigai(at)ak(dot)jp(dot)nec(dot)com> wrote:
>> Don't the changes to src/backend/optimizer/plan/createplan.c belong in
>> patch #2?
>>
> The borderline between #1 and #2 is little bit bogus. So, I moved most of
> portion into #1, however, invocation of InitCustomScan (that is a callback
> in CustomPlanMethod) in create_custom_plan() is still in #2.

Eh, create_custom_scan() certainly looks like it is in #1 from here,
or at least part of it is. It calculates tlist and clauses and then
does nothing with them. That clearly can't be the right division.

I think it would make sense to have create_custom_scan() compute tlist
and clauses first, and then pass those to CreateCustomPlan(). Then
you don't need a separate InitCustomScan() - which is misnamed anyway,
since it has nothing to do with ExecInitCustomScan().

> OK, I revised. Now custom-scan assumes it has a particular valid relation
> to be scanned, so no code path with scanrelid == 0 at this moment.
>
> Let us revisit this scenario when custom-scan replaces relation-joins.
> In this case, custom-scan will not be associated with a particular base-
> relation, thus it needs to admit a custom-scan node with scanrelid == 0.

Yeah, I guess the question there is whether we'll want let CustomScan
have scanrelid == 0 or require that CustomJoin be used there instead.

>> Why can't the Custom(GpuHashJoin) node build the hash table internally
>> instead of using a separate node?
>>
> It's possible, however, it prevents to check sub-plans using EXPLAIN if we
> manage inner-plans internally. So, I'd like to have a separate node being
> connected to the inner-plan.

Isn't that just a matter of letting the EXPLAIN code print more stuff?
Why can't it?

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Geoghegan 2014-09-11 20:13:26 Re: B-Tree support function number 3 (strxfrm() optimization)
Previous Message Gavin Flower 2014-09-11 19:45:33 Re: Aussie timezone database changes incoming