Re: Custom/Foreign-Join-APIs (Re: [v9.5] Custom Plan API)

Поиск
Список
Период
Сортировка
От Shigeru HANADA
Тема Re: Custom/Foreign-Join-APIs (Re: [v9.5] Custom Plan API)
Дата
Msg-id B381E803-5E15-4AD1-8694-E0706A8596D0@gmail.com
обсуждение исходный текст
Ответ на Re: Custom/Foreign-Join-APIs (Re: [v9.5] Custom Plan API)  (Kouhei Kaigai <kaigai@ak.jp.nec.com>)
Ответы Re: Custom/Foreign-Join-APIs (Re: [v9.5] Custom Plan API)  (Kouhei Kaigai <kaigai@ak.jp.nec.com>)
Список pgsql-hackers
2015/03/23 9:12、Kouhei Kaigai <kaigai@ak.jp.nec.com> のメール:

> Sorry for my response late. It was not easy to code during business trip.
>
> The attached patch adds a hook for FDW/CSP to replace entire join-subtree
> by a foreign/custom-scan, according to the discussion upthread.
>
> GetForeignJoinPaths handler of FDW is simplified as follows:
>  typedef void (*GetForeignJoinPaths_function) (PlannerInfo *root,
>                                                RelOptInfo *joinrel);

It’s not a critical issue but I’d like to propose to rename add_joinrel_extra_paths() to add_extra_paths_to_joinrel(),
becausethe latter would make it more clear that it does extra work in addition to add_paths_to_joinrel(). 

> It takes PlannerInfo and RelOptInfo of the join-relation to be replaced
> if available. RelOptInfo contains 'relids' bitmap, so FDW driver will be
> able to know the relations to be involved and construct a remote join query.
> However, it is not obvious with RelOptInfo to know how relations are joined.
>
> The function below will help implement FDW driver that support remote join.
>
>  List *
>  get_joinrel_broken_down(PlannerInfo *root, RelOptInfo *joinrel,
>                          SpecialJoinInfo **p_sjinfo)
>
> It returns a list of RelOptInfo to be involved in the relations join that
> is represented with 'joinrel', and also set a SpecialJoinInfo on the third
> argument if not inner join.
> In case of inner join, it returns multiple (more than or equal to 2)
> relations to be inner-joined. Elsewhere, it returns two relations and
> a valid SpecialJoinInfo.

As far as I tested, it works fine for SEMI and ANTI.
# I want dump function of BitmapSet for debugging, as Node has nodeToString()...

> At this moment, I'm not 100% certain about its logic. Especially, I didn't
> test SEMI- and ANTI- join cases yet.
> However, time is money - I want people to check overall design first, rather
> than detailed debugging. Please tell me if I misunderstood the logic to break
> down join relations.

With applying your patch, regression tests of “updatable view” failed.  regression.diff contains some errors like this:
! ERROR:  could not find RelOptInfo for given relids

Could you check that?

—
Shigeru HANADA


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

Предыдущее
От: Tomas Vondra
Дата:
Сообщение: Re: WIP: multivariate statistics / proof of concept
Следующее
От: Michael Paquier
Дата:
Сообщение: Re: Error with index on unlogged table