Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TPC-H query 02 failed. #851

Open
0-kaz opened this issue Nov 7, 2024 · 0 comments
Open

TPC-H query 02 failed. #851

0-kaz opened this issue Nov 7, 2024 · 0 comments

Comments

@0-kaz
Copy link
Contributor

0-kaz commented Nov 7, 2024

I found this issue with PG15.8

select s_acctbal,
       s_name,
       n_name,
       p_partkey,
       p_mfgr,
       s_address,
       s_phone,
       s_comment
  from part,
       supplier,
       partsupp,
       nation,
       region
 where p_partkey = ps_partkey
   and s_suppkey = ps_suppkey
   and p_size = 15
   and p_type like '%STEEL'
   and s_nationkey = n_nationkey
   and n_regionkey = r_regionkey
   and r_name = 'MIDDLE EAST'
   and ps_supplycost = (select min(ps_supplycost)
                          from partsupp,
                               supplier,
                               nation,
                               region
                         where p_partkey = ps_partkey
                           and s_suppkey = ps_suppkey
                           and s_nationkey = n_nationkey
                           and n_regionkey = r_regionkey
                           and r_name = 'MIDDLE EAST'
                       )
 order by s_acctbal desc,
          n_name,
          s_name,
          p_partkey;

Query plan

 Sort  (cost=1210394921.81..1210394921.81 rows=1 width=270)
   Sort Key: supplier.s_acctbal DESC, nation.n_name, supplier.s_name, part.p_partkey
   ->  Hash Join  (cost=81248.03..1210394921.80 rows=1 width=270)
         Hash Cond: ((part.p_partkey = partsupp.ps_partkey) AND ((SubPlan 1) = partsupp.ps_supplycost))
         ->  Custom Scan (GpuScan) on part  (cost=100.00..41774.46 rows=8746 width=30)
               GPU Projection: p_partkey, p_mfgr
               GPU Scan Quals: ((p_size = 15) AND ((p_type)::text ~~ '%STEEL'::text)) [rows: 1999983 -> 8746]
               GPU-Direct SQL: enabled (N=1,GPU0-0)
         ->  Hash  (cost=80456.53..80456.53 rows=46100 width=250)
               ->  Gather  (cost=2559.58..80456.53 rows=46100 width=250)
                     Workers Planned: 2
                     ->  Parallel Custom Scan (GpuJoin) on partsupp  (cost=1559.58..74846.53 rows=19208 width=250)
                           GPU Projection: supplier.s_acctbal, supplier.s_name, supplier.s_address, supplier.s_phone, supplier.s_comment, partsupp.ps_partkey, partsupp.ps_supplycost, nation.n_name
                           GPU Join Quals [1]: (supplier.s_suppkey = partsupp.ps_suppkey) ... [nrows: 3333403 -> 19208]
                           GPU Outer Hash [1]: partsupp.ps_suppkey
                           GPU Inner Hash [1]: supplier.s_suppkey
                           GPU-Direct SQL: enabled (N=1,GPU0-0)
                           ->  Parallel Custom Scan (GpuJoin) on supplier  (cost=124.22..1452.83 rows=346 width=244)
                                 GPU Projection: supplier.s_acctbal, supplier.s_name, supplier.s_address, supplier.s_phone, supplier.s_comment, supplier.s_suppkey, nation.n_name
                                 GPU Join Quals [1]: (supplier.s_nationkey = nation.n_nationkey) ... [nrows: 58824 -> 58824]
                                 GPU Outer Hash [1]: supplier.s_nationkey
                                 GPU Inner Hash [1]: nation.n_nationkey
                                 GPU Join Quals [2]: (nation.n_regionkey = region.r_regionkey) ... [nrows: 58824 -> 346]
                                 GPU Outer Hash [2]: nation.n_regionkey
                                 GPU Inner Hash [2]: region.r_regionkey
                                 GPU-Direct SQL: enabled (N=1,GPU0-0)
                                 ->  Parallel Seq Scan on nation  (cost=0.00..11.00 rows=100 width=112)
                                 ->  Parallel Seq Scan on region  (cost=0.00..11.25 rows=1 width=4)
                                       Filter: (r_name = 'MIDDLE EAST'::bpchar)
         SubPlan 1
           ->  Aggregate  (cost=276760.09..276760.10 rows=1 width=32)
                 ->  Custom Scan (GpuPreAgg) on supplier supplier_1  (cost=276760.08..276760.09 rows=1 width=32)
                       GPU Projection: pgstrom.pmin((partsupp_1.ps_supplycost)::double precision)
                       GPU Join Quals [1]: (partsupp_1.ps_suppkey = supplier_1.s_suppkey) ... [nrows: 100000 -> 19]
                       GPU Outer Hash [1]: supplier_1.s_suppkey
                       GPU Inner Hash [1]: partsupp_1.ps_suppkey
                       GPU Join Quals [2]: (supplier_1.s_nationkey = nation_1.n_nationkey) ... [nrows: 19 -> 1]
                       GPU Outer Hash [2]: supplier_1.s_nationkey
                       GPU Inner Hash [2]: nation_1.n_nationkey
                       GPU-Direct SQL: enabled (N=1,GPU0-0)
                       ->  Seq Scan on partsupp partsupp_1  (cost=0.00..274388.09 rows=19 width=10)
                             Filter: (part.p_partkey = ps_partkey)
                       ->  Hash Join  (cost=12.14..24.48 rows=1 width=4)
                             Hash Cond: (nation_1.n_regionkey = region_1.r_regionkey)
                             ->  Seq Scan on nation nation_1  (cost=0.00..11.70 rows=170 width=8)
                             ->  Hash  (cost=12.12..12.12 rows=1 width=4)
                                   ->  Seq Scan on region region_1  (cost=0.00..12.12 rows=1 width=4)
                                         Filter: (r_name = 'MIDDLE EAST'::bpchar)
(48 rows)

Server process down.

server closed the connection unexpectedly
        This probably means the server terminated abnormally
        before or while processing the request.
The connection to the server was lost. Attempting reset: Failed.
The connection to the server was lost. Attempting reset: Failed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant