环境:
30.119上安装了oracle 11g最稳定版本11.2.0.4,已经导入10g tpch数据
登录oracle数据库
su - oracle
sqlplus test/oracle // tpch数据都创建在test用户下,已赋予dba权限
10g数据,在oracle中慢sql17执行需要7秒
SQL> select
2 sum(l_extendedprice) / 7.0 as avg_yearly
3 from
4 lineitem,
5 part
6 where
7 p_partkey = l_partkey
8 and p_brand = 'Brand#23'
9 and p_container = 'MED BOX'
10 and l_quantity < (
11 select
12 0.2 * avg(l_quantity)
13 from
14 lineitem
15 where
16 l_partkey = p_partkey
17 );
AVG_YEARLY
----------
3295493.51
Elapsed: 00: