--分析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 1 n/a RETURN (
1) 0.000232826
| 1 n/a FETCH (
2) 0.000232826
| 1.2e+06 n/a Table: DB2INST1
CRB_TEST