FILTER 执行次数

select  count(*) from SAVJ_ATOMJOURBAK where ((list_flag='1' and prt_flag='0') and acct_no not
in (select  acct_no  from savb_basicinfo1 where ((card_no is  not null  and base_acct_no is null
) or (book_flag='1' and bus_code=21))))

select count(*)
  from SAVJ_ATOMJOURBAK
 where list_flag = '1'
   and prt_flag = '0'
   and acct_no not in
       (select acct_no
          from savb_basicinfo1
         where ((card_no is not null and base_acct_no is null) or
               (book_flag = '1' and bus_code = 21)))

SQL> select * from table(dbms_xplan.display_cursor(null,null,'allstats last'));

PLAN_TABLE_OUTPUT
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
SQL_ID  8dx0u725jfawb, child number 0
-------------------------------------
select  count(*) from SAVJ_ATOMJOURBAK where ((list_flag='1' and prt_flag='0') and acct_no not
in (select  acct_no  from savb_basicinfo1 where ((card_no is  not null  and base_acct_no is null
) or (book_flag='1' and bus_code=21))))

Plan hash value: 3431125892

----------------------------------------------------------------------------------------------------------
| Id  | Operation           | Name            | Starts | E-Rows | A-Rows |   A-Time   | Buffers | Reads  |
----------------------------------------------------------------------------------------------------------
|   1 |  SORT AGGREGATE     |                 |      1 |      1 |      1 |00:01:40.72 |    5428K|   4184K|
|*  2 |   FILTER            |                 |      1 |        |    254 |00:01:40.71 |    5428K|   4184K|
|*  3 |    TABLE ACCESS FULL| SAVJ_ATOMJOUR1  |      1 |    678 |    659 |00:00:00.01 |      68 |      0 |
|*  4 |    TABLE ACCESS FULL| SAVB_BASICINFO1 |    187 |      1 |    118 |00:01:40.71 |    5428K|   4184K|
----------------------------------------------------------------------------------------------------------

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

   2 - filter( IS NULL)
   3 - filter(("PRT_FLAG"='0' AND "LIST_FLAG"='1'))
   4 - filter(((("BASE_ACCT_NO" IS NULL AND "CARD_NO" IS NOT NULL) OR ("BUS_CODE"=21 AND
              "BOOK_FLAG"='1')) AND LNNVL("ACCT_NO"<>:B1)))

SQL> select * from table(dbms_xplan.display());

PLAN_TABLE_OUTPUT
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

----------------------------------------------------------------------------
| Id  | Operation           | Name            | Rows  | Bytes | Cost (%CPU)|
----------------------------------------------------------------------------
|   0 | SELECT STATEMENT    |                 |     1 |    37 |  2776K  (1)|
|   1 |  SORT AGGREGATE     |                 |     1 |    37 |            |
|*  2 |   FILTER            |                 |       |       |            |
|*  3 |    TABLE ACCESS FULL| SAVJ_ATOMJOUR1  |   678 | 25086 |    16   (0)|
|*  4 |    TABLE ACCESS FULL| SAVB_BASICINFO1 |     1 |    74 |  8186   (1)|
----------------------------------------------------------------------------

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

   2 - filter( NOT EXISTS (SELECT /*+ */ 0 FROM "SAVB_BASICINFO1"
              "SAVB_BASICINFO1" WHERE ("BASE_ACCT_NO" IS NULL AND "CARD_NO" IS NOT
              NULL OR "BUS_CODE"=21 AND "BOOK_FLAG"='1') AND LNNVL("ACCT_NO"<>:B1)))
   3 - filter("PRT_FLAG"='0' AND "LIST_FLAG"='1')
   4 - filter(("BASE_ACCT_NO" IS NULL AND "CARD_NO" IS NOT NULL OR
              "BUS_CODE"=21 AND "BOOK_FLAG"='1') AND LNNVL("ACCT_NO"<>:B1))

Note
-----
   - 'PLAN_TABLE' is old version

24 rows selected.


25 rows selected.

SAVB_BASICINFO1 扫描187次

一般FILTER 对应的ID 下面有EXISTS
EXISTS里面有 绑定变量这种
它就表示了子查看没被解套,或者说是子查询没有展开
没发生 unnest






转载于:https://www.cnblogs.com/zhaoyangjian724/p/3798014.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值