Slide 29
Slide 29 text
Custom-Scan APIs(3/5)
20250906~日本発のOSS爆速DB「PG-Strom」開発の歴史と展望
29
ssbm=# explain select sum(lo_revenue), d_year, p_brand1
from lineorder, date1, part, supplier
where lo_orderdate = d_datekey
and lo_partkey = p_partkey
and lo_suppkey = s_suppkey
and p_category = 'MFGR#12’
and s_region = 'AMERICA’
group by d_year, p_brand1;
QUERY PLAN
------------------------------------------------------------------------------------------------------------
HashAggregate (cost=30939287.03..30939374.53 rows=7000 width=46)
Group Key: date1.d_year, part.p_brand1
-> Custom Scan (GpuPreAgg) on lineorder (cost=30939164.53..30939234.53 rows=7000 width=46)
GPU Projection: pgstrom.psum(lineorder.lo_revenue), date1.d_year, part.p_brand1
GPU Join Quals [1]: (part.p_partkey = lineorder.lo_partkey) ... [nrows: 6000026000 -> 236602000]
GPU Outer Hash [1]: lineorder.lo_partkey
GPU Inner Hash [1]: part.p_partkey
GPU Join Quals [2]: (supplier.s_suppkey = lineorder.lo_suppkey) ... [nrows: 236602000 -> 47146910]
GPU Outer Hash [2]: lineorder.lo_suppkey
GPU Inner Hash [2]: supplier.s_suppkey
GPU Join Quals [3]: (date1.d_datekey = lineorder.lo_orderdate) ... [nrows: 47146910 -> 47146910]
GPU Outer Hash [3]: lineorder.lo_orderdate
GPU Inner Hash [3]: date1.d_datekey
GPU Group Key: date1.d_year, part.p_brand1
GPU-Direct SQL: enabled (N=2,GPU0,1)
-> Custom Scan (GpuScan) on part (cost=100.00..30481.17 rows=78867 width=14)
GPU Projection: p_brand1, p_partkey
GPU Scan Quals: (p_category = 'MFGR#12'::bpchar) [rows: 2000000 -> 78867]
GPU-Direct SQL: enabled (N=2,GPU0,1)
-> Custom Scan (GpuScan) on supplier (cost=100.00..190276.56 rows=1992611 width=6)
GPU Projection: s_suppkey
GPU Scan Quals: (s_region = 'AMERICA'::bpchar) [rows: 9999718 -> 1992611]
GPU-Direct SQL: enabled (N=2,GPU0,1)
-> Seq Scan on date1 (cost=0.00..72.56 rows=2556 width=8)
(24 rows)
2014