加载中…
个人资料
  • 博客等级:
  • 博客积分:
  • 博客访问:
  • 关注人气:
  • 获赠金笔:0支
  • 赠出金笔:0支
  • 荣誉徽章:
正文 字体大小:

db2 的rid 扫描 类似于 oracle的 rowid 扫描

(2010-11-10 15:32:53)
标签:

it

分类: db2

--分析sql

select * from crb_test where rid(crb_test)=1376518147

 

[db2inst1@localhost C0000000.TMP]$ dynexpln -d suzhou -q "select * from crb_test where rid(crb_test)=1376518147" -g -i -t

DB2 Universal Database Version 9.7, 5622-044 (c) Copyright IBM Corp. 1997, 2008
Licensed Material - Program Property of IBM
IBM DATABASE 2 Dynamic SQL Explain Tool


NOTE: db2expln can now process dynamic statements directly and should
      be used instead of dynexpln.


CONNECT TO suzhou

   Database Connection Information

 Database server        = DB2/LINUX 9.7.1
 SQL authorization ID   = DB2INST1
 Local database alias   = SUZHOU


PREP DYNEXPLN.sqc PACKAGE USING DYNEXPLN

LINE    MESSAGES FOR DYNEXPLN.sqc
------  --------------------------------------------------------------------
        SQL0060W  The "C" precompiler is in progress.
        SQL0091W  Precompilation or binding was ended with "0"
                  errors and "0" warnings.

TERMINATE
DB20000I  The TERMINATE command completed successfully.


DB2 Universal Database Version 9.7, 5622-044 (c) Copyright IBM Corp. 1991, 2008
Licensed Material - Program Property of IBM
IBM DB2 Universal Database SQL and XQUERY Explain Tool

DB2 Universal Database Version 9.7, 5622-044 (c) Copyright IBM Corp. 1991, 2008
Licensed Material - Program Property of IBM
IBM DB2 Universal Database SQL and XQUERY Explain Tool

******************** PACKAGE ***************************************

Package Name = "DB2INST1"."DYNEXPLN"  Version = ""

        Prep Date = 2010/11/10
        Prep Time = 15:13:08

        Bind Timestamp = 2010-11-10-15.13.08.276868

        Isolation Level          = Cursor Stability
        Blocking                 = Block Unambiguous Cursors
        Query Optimization Class = 5

        Partition Parallel       = No
        Intra-Partition Parallel = No

        SQL Path                 = "SYSIBM", "SYSFUN", "SYSPROC", "SYSIBMADM",
                                   "DB2INST1"

-------------------- SECTION ---------------------------------------
Section = 1


Statement:
  DECLARE C1 CURSOR
  FOR
     select *
     from crb_test
     where rid(crb_test)=1376518147


Section Code Page = 1208

Estimated Cost = 0.000233           --这么低的cost 真少见
Estimated Cardinality = 1.000000

   2) Access Table Name = DB2INST1.CRB_TEST  ID = 4,5654
        #Columns = 4
        Single Record
        Skip Inserted Rows
        Fetch Direct Using Row IDs
        Lock Intents
        Table: Intent Share
        Row  : Next Key Share
   1) Return Data to Application
        #Columns = 4

End of section


Optimizer Plan:

     Rows  
   Operator
     (ID)  
     Cost  
            
         
     n/a    
   RETURN   
    ( 1)    
 0.000232826
         
         
     n/a    
    FETCH   
    ( 2)    
 0.000232826
       
  1.2e+06 
    n/a   
  Table:  
  DB2INST1
  CRB_TEST

0

阅读 收藏 喜欢 打印举报/Report
  

新浪BLOG意见反馈留言板 欢迎批评指正

新浪简介 | About Sina | 广告服务 | 联系我们 | 招聘信息 | 网站律师 | SINA English | 产品答疑

新浪公司 版权所有