> -----Original Message----- > From: [email protected] > [mailto:[email protected]] On Behalf Of Tom Lane > Sent: Thursday, May 28, 2015 5:35 AM > To: Robert Haas > Cc: Kaigai Kouhei(海外 浩平); Thom Brown; Kohei KaiGai; Shigeru Hanada; > [email protected] > Subject: Re: [HACKERS] Construction of Plan-node by CSP (RE: > Custom/Foreign-Join-APIs) > > Robert Haas <[email protected]> writes: > > Tom, do you want to review this patch and figure out how to solve the > > underlying problem? If not, I will take care of it. But I will be > > unhappy if I put time and effort into this and then you insist on > > changing everything afterwards, again. > > [ sorry for slow response, been busy ] I will take a look. > Tom, how about your availability?
>From my side, I adjust my extension (PG-Strom) to fit the infrastructure you
>proposed,
then confirmed it is workable even if custom-scan, that replaced relations
join, takes
more than two Path nodes in the custom_children list of CustomPath, with no
exportiong
create_plan_recurse().
Below is an example of custom-scan (GpuJoin) that involves four relations join.
Its code base is the latest master + custom-join-children.v2.patch; unchanged
from
the last post.
postgres=# explain analyze select avg(x) from t0 natural join t1 natural join
t2 natural join t3 group by cat;
QUERY PLAN
----------------------------------------------------------------------------------------------------------------------------------
HashAggregate (cost=298513.77..298514.10 rows=26 width=12) (actual
time=5622.028..5622.033 rows=26 loops=1)
Group Key: t0.cat
-> Custom Scan (GpuJoin) (cost=4702.00..249169.85 rows=9868784 width=12)
(actual time=540.718..2075.566 rows=10000000 loops=1)
Bulkload: On (density: 100.00%)
Depth 1: Logic: GpuHashJoin, HashKeys: (cid), JoinQual: (cid = cid),
nrows_ratio: 0.98936439
Depth 2: Logic: GpuHashJoin, HashKeys: (bid), JoinQual: (bid = bid),
nrows_ratio: 0.99748135
Depth 3: Logic: GpuHashJoin, HashKeys: (aid), JoinQual: (aid = aid),
nrows_ratio: 1.00000000
-> Custom Scan (BulkScan) on t0 (cost=0.00..242858.60 rows=10000060
width=24) (actual time=8.555..903.864 rows=10000000 loops=1)
-> Seq Scan on t3 (cost=0.00..734.00 rows=40000 width=4) (actual
time=0.019..4.370 rows=40000 loops=1)
-> Seq Scan on t2 (cost=0.00..734.00 rows=40000 width=4) (actual
time=0.004..4.182 rows=40000 loops=1)
-> Seq Scan on t1 (cost=0.00..734.00 rows=40000 width=4) (actual
time=0.005..4.275 rows=40000 loops=1)
Planning time: 0.918 ms
Execution time: 6178.264 ms
(13 rows)
Thanks,
--
NEC Business Creation Division / PG-Strom Project
KaiGai Kohei <[email protected]>
custom-join-children.v2.patch
Description: custom-join-children.v2.patch
-- Sent via pgsql-hackers mailing list ([email protected]) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers
