查看sql的执行计划

SQL> set autotrace traceonly explain;
SQL> select count(*) from AP.AP_CHECKS_ALL#;

Execution Plan
----------------------------------------------------------
Plan hash value: 2507571169

-------------------------------------------------------------------------
| Id  | Operation        | Name         | Rows  | Cost (%CPU)| Time     |
-------------------------------------------------------------------------
|   0 | SELECT STATEMENT |              |     1 |    99   (2)| 00:00:01 |
|   1 |  SORT AGGREGATE  |              |     1 |            |          |
|   2 |   INDEX FULL SCAN| AP_CHECKS_N4 | 33055 |    99   (2)| 00:00:01 |
-------------------------------------------------------------------------

SQL> select count(*) from  apps.AP_CHECKS;

Execution Plan
----------------------------------------------------------
Plan hash value: 2769988729

--------------------------------------------------------------------------
| Id  | Operation         | Name         | Rows  | Cost (%CPU)| Time     |
--------------------------------------------------------------------------
|   0 | SELECT STATEMENT  |              |     1 |     0   (0)|          |
|   1 |  SORT AGGREGATE   |              |     1 |            |          |
|*  2 |   FILTER          |              |       |            |          |
|   3 |    INDEX FULL SCAN| AP_CHECKS_N4 | 33055 |    99   (2)| 00:00:01 |
--------------------------------------------------------------------------

Predicate Information (identified by operation id):
---------------------------------------------------

   2 - filter(NULL IS NOT NULL)

SQL> select * from  AP.AP_CHECKS_ALL#;

Execution Plan
----------------------------------------------------------
Plan hash value: 549637158

--------------------------------------------------------------------------------
---

| Id  | Operation         | Name          | Rows  | Bytes | Cost (%CPU)| Time
  |

--------------------------------------------------------------------------------
---

|   0 | SELECT STATEMENT  |               | 33055 |    10M|   531   (3)| 00:00:0
1 |

|   1 |  TABLE ACCESS FULL| AP_CHECKS_ALL | 33055 |    10M|   531   (3)| 00:00:0
1 |

--------------------------------------------------------------------------------
---


SQL> select * from apps.AP_CHECKS;

Execution Plan
----------------------------------------------------------
Plan hash value: 2927437457

--------------------------------------------------------------------------------
----

| Id  | Operation          | Name          | Rows  | Bytes | Cost (%CPU)| Time
   |

--------------------------------------------------------------------------------
----

|   0 | SELECT STATEMENT   |               |     1 |   325 |     0   (0)|
   |

|*  1 |  FILTER            |               |       |       |            |
   |

|   2 |   TABLE ACCESS FULL| AP_CHECKS_ALL | 33055 |    10M|   531   (3)| 00:00:
01 |

--------------------------------------------------------------------------------
----


Predicate Information (identified by operation id):
---------------------------------------------------

   1 - filter(NULL IS NOT NULL)

SQL> select * from apps.AP_CHECKS where amount='90000'
  2  ;

Execution Plan
----------------------------------------------------------
Plan hash value: 2927437457

--------------------------------------------------------------------------------
----

| Id  | Operation          | Name          | Rows  | Bytes | Cost (%CPU)| Time
   |

--------------------------------------------------------------------------------
----

|   0 | SELECT STATEMENT   |               |     1 |   325 |     0   (0)|
   |

|*  1 |  FILTER            |               |       |       |            |
   |

|*  2 |   TABLE ACCESS FULL| AP_CHECKS_ALL |     3 |   975 |   518   (1)| 00:00:
01 |

--------------------------------------------------------------------------------
----


Predicate Information (identified by operation id):
---------------------------------------------------

   1 - filter(NULL IS NOT NULL)
   2 - filter("AMOUNT"=90000)

SQL> select * from AP.AP_CHECKS_ALL# where amount='90000'
  2  ;

Execution Plan
----------------------------------------------------------
Plan hash value: 549637158

--------------------------------------------------------------------------------
---

| Id  | Operation         | Name          | Rows  | Bytes | Cost (%CPU)| Time
  |

--------------------------------------------------------------------------------
---

|   0 | SELECT STATEMENT  |               |     3 |   975 |   518   (1)| 00:00:0
1 |

|*  1 |  TABLE ACCESS FULL| AP_CHECKS_ALL |     3 |   975 |   518   (1)| 00:00:0
1 |

--------------------------------------------------------------------------------
---


Predicate Information (identified by operation id):
---------------------------------------------------

   1 - filter("AMOUNT"=90000)

SQL> 

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值