|
sql文档居然没有介绍察看计划的explain命令,被我胡测出来了
SQL> explain select 1 from dual;
Use time:16 ms.
plan_path(VARCHAR(-1)) |
-------------------------------------L1-------------------------------------
<NVL> |
Total 1 records.
SQL> explain
2 select
3 l_orderkey,
4 sum(l_extendedprice * (1 - l_discount)) as revenue,
5 o_orderdate,
6 o_shippriority
7 from
8 customer,
9 orders,
10 lineitem
11 where
12 c_mktsegment = 'HOUSEHOLD'
13 and c_custkey = o_custkey
14 and l_orderkey = o_orderkey
15 and o_orderdate < date '1995-03-09'
16 and l_shipdate > date '1995-03-09'
17 group by
18 l_orderkey,
19 o_orderdate,
20 o_shippriority
21 order by
22 revenue desc,
23 o_orderdate
24 limit 10
25 ;
Use time:0 ms.
plan_path(VARCHAR(-1)) |
-------------------------------------L1-------------------------------------
Sort[cost=321852777,result_num=2400000]
(HashGroup[cost=269052777,result_num=2400000]
(HashJoin[cost=259452777,result_num=2400000]
(SeqScan[cost=59986052,result_num=23994421](table=LINEITEM),
HashJoin[cost=53100100,result_num=600000]
(SeqScan[cost=15000000,result_num=6000000](table=ORDERS),
SeqScan[cost=1500000,result_num=150000](table=CUSTOMER))))) |
Total 1 records.
SQL> |
|