我正在研究tpch基准测试,它有一组22个查询。在查询号15中有一个涉及的视图,在创建视图后我去运行查询一切只是冻结没有结果任何人都可以帮助我。顺便说一句,在Postgres上同样的查询会在3.68秒内返回。查看和查询位于
之下 create view revenue0 (supplier_no, total_revenue) as
select
l_suppkey,
sum(l_extendedprice * (1 - l_discount))
from
lineitem
where
l_shipdate >= date '1997-05-01'
and l_shipdate < dateadd(month, 3, date '1997-05-01')
group by
l_suppkey;
查询
select
s_suppkey,
s_name,
s_address,
s_phone,
total_revenue
from
supplier,
revenue0
where
s_suppkey = supplier_no
and total_revenue = (
select
max(total_revenue)
from
revenue0
)
order by
s_suppkey;