stonedb icon indicating copy to clipboard operation
stonedb copied to clipboard

bug: slow-SQL-Q18-when subquery use sum and in sql spend too much time

Open adofsauron opened this issue 1 year ago • 0 comments

Describe the problem

  1. use tpch data
  2. exec sql

`

-- using default substitutions

select c_name, c_custkey, o_orderkey, o_orderdate, o_totalprice, sum(l_quantity) from customer, orders, lineitem where o_orderkey in ( select l_orderkey from lineitem group by l_orderkey having sum(l_quantity) > 300 ) and c_custkey = o_custkey and o_orderkey = l_orderkey group by c_name, c_custkey, o_orderkey, o_orderdate, o_totalprice order by o_totalprice desc, o_orderdate limit 100;

`

Expected behavior

No response

How To Reproduce

No response

Environment

No response

Are you interested in submitting a PR to solve the problem?

  • [X] Yes, I will!

adofsauron avatar Jul 28 '22 14:07 adofsauron