熱點推薦:
您现在的位置: 電腦知識網 >> 編程 >> Oracle >> 正文

sql走索引,怎麼始終有物理讀?

2013-11-13 12:46:52  來源: Oracle 

  問題是這樣的

   sql> r

       select count(*)

       from t_edu_member_info

     * where status= and xs_zy=

   執行計劃

  

            SELECT STATEMENT Optimizer=ALL_ROWS (Cost= Card= Bytes=)

             SORT (AGGREGATE)

               FILTER

                 INDEX (RANGE SCAN) OF IND_T_PREBM (NONUNIQUE) (Cost= Card= Bytes=)

  

   統計信息

  

              recursive calls

              db block gets

               consistent gets

               physical reads

             redo size

             bytes sent via SQL*Net to client

             bytes received via SQL*Net from client

               SQL*Net roundtrips to/from client

               sorts (memory)

               sorts (disk)

               rows processed

  這個結果已經跑了幾次但是 recursive calls 依然存在後來從事件產生的trace文件中到了線索用tkprof格式化trace文件後可以看到

   select count(*)

   from t_edu_member_info

   where status=

   and xs_zy=

   call     count       cpu    elapsed       disk      query    current        rows

      

   Parse                                                             

   Execute                                                          

   Fetch                                                             

      

   total                                                            

  

   Misses in library cache during parse:

   Optimizer mode: ALL_ROWS

   Parsing user id:

  

   Rows     Row Source Operation

    

           SORT AGGREGATE

            FILTER

             INDEX RANGE SCAN IND_T_PREBM (object id )

  

   Elapsed times include waiting on following events:

     Event waited on                             Times   Max Wait  Total Waited

        Waited   

     direct path write                                                

     SQL*Net message to client                                        

     SQL*Net message from client                                    

   insert into sysfga_log$(sessionidtimestamp#dbuidosuidobj$schemaobj$name

     policynamescnplholsqlbindoshstclientidextidlsqltext)

   values

    (:sysdate::::::::::::)

   call     count       cpu    elapsed       disk      query    current        rows

      

   Parse                                                             

   Execute                                                           

   Fetch                                                             

      

   total                                                             

  

   Misses in library cache during parse:

   Optimizer mode: CHOOSE

   Parsing user id: SYS   (recursive depth: )

  

   Elapsed times include waiting on following events:

     Event waited on                             Times   Max Wait  Total Waited

        Waited   

     direct path read (lob)                                           

  原來是打開了審計功能


From:http://tw.wingwit.com/Article/program/Oracle/201311/16570.html
    推薦文章
    Copyright © 2005-2013 電腦知識網 Computer Knowledge   All rights reserved.