Re: Custom Scan APIs (Re: Custom Plan node)
Shigeru Hanada <shigeru.hanada@gmail.com>
From: Shigeru Hanada <shigeru.hanada@gmail.com>
To: Kohei KaiGai <kaigai@kaigai.gr.jp>
Cc: Kouhei Kaigai <kaigai@ak.jp.nec.com>, Stephen Frost <sfrost@snowman.net>,
Jim Mlodgenski <jimmy76@gmail.com>, Robert Haas <robertmhaas@gmail.com>,
Tom Lane <tgl@sss.pgh.pa.us>,
PgHacker <pgsql-hackers@postgresql.org>, Peter Eisentraut <peter_e@gmx.net>
Date: 2014-02-26T03:14:13Z
Lists: pgsql-hackers
Hi Kaigai-san,
2014-02-23 22:24 GMT+09:00 Kohei KaiGai <kaigai@kaigai.gr.jp>:
> (1) Interface to add alternative paths in addition to built-in join paths
I found that create_custom_path is not used at all in your patch.
I revised postgresql_fdw.c to use it like this.
...
/* Create join information which is stored as private information. */
memset(&jinfo, 0, sizeof(PgRemoteJoinInfo));
jinfo.fdw_server_oid = o_server_oid;
jinfo.fdw_user_oid = o_user_oid;
jinfo.relids = joinrel->relids;
jinfo.jointype = jointype;
jinfo.outer_rel = o_relinfo;
jinfo.inner_rel = i_relinfo;
jinfo.remote_conds = j_remote_conds;
jinfo.local_conds = j_local_conds;
/* OK, make a CustomScan node to run remote join */
cpath = create_customscan_path(root,
joinrel,
0, 0, 0, /* estimate later */
NIL,
required_outer,
"postgres-fdw",
0,
packPgRemoteJoinInfo(&jinfo));
estimate_remote_join_cost(root, cpath, &jinfo, sjinfo);
add_path(joinrel, &cpath->path);
...
This seems to work fine. Is this right approach? If so,this portion
would be a good example to replace local join with custom scan for
authors of custom scan providers. One thing I worry is the case that
you've intentionally avoided calling create_customscan_path.
--
Shigeru HANADA
Commits
Same data as JSON:
GET /api/v1/messages/:b64id/commits
the thread's linked commits as JSON, with link sources.
API reference →
-
Support multi-argument UNNEST(), and TABLE() syntax for multiple functions.
- 784e762e886e 9.4.0 cited