我做了一个测试db2expln -d ubtdb -g -q "select VISIT_ID from DW_DPA.TSA_DPA_VISIT where 1=1" -t VISIT_ID是这个表的主键,这条搜索会走索引[db2inst1@dadw ~]$ db2expln -d ubtdb -g -q "select VISIT_ID from DW_DPA.TSA_DPA_VISIT where 1...
显示全部我做了一个测试
db2expln -d ubtdb -g -q "select VISIT_ID from DW_DPA.TSA_DPA_VISIT where 1=1" -t
VISIT_ID是这个表的主键,这条搜索会走索引
[db2inst1@dadw ~]$ db2expln -d ubtdb -g -q "select VISIT_ID from DW_DPA.TSA_DPA_VISIT where 1=1" -t
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
******************** DYNAMIC ***************************************
==================== STATEMENT ==========================================
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"
Statement:
select VISIT_ID
from DW_DPA.TSA_DPA_VISIT
where 1=1
Section Code Page = 1208
Estimated Cost = 51293.703125
Estimated Cardinality = 8218489.000000
Access Table Name = DW_DPA.TSA_DPA_VISIT ID = -6,-32754
| Index Scan: Name = SYSIBM.SQL110801091540160 ID = 1
| | Regular Index (Not Clustered)
| | Index Columns:
| | | 1: VISIT_ID (Ascending)
| #Columns = 1
| Data-Partitioned Table
| Skip Inserted Rows
| Avoid Locking Committed Data
| Currently Committed for Cursor Stability
| All data partitions will be accessed
| #Key Columns = 0
| | Start Key: Beginning of Index
| | Stop Key: End of Index
| Index-Only Access
| Index Prefetch: Eligible 41763
| Lock Intents
| | Table: Intent Share
| | Row : Next Key Share
| Sargable Index Predicate(s)
| | Return Data to Application
| | | #Columns = 1
Return Data Completion
End of section
Optimizer Plan:
Rows
Operator
(ID)
Cost
8.21849e+06
RETURN
( 1)
51293.7
|
8.21849e+06
IXSCAN
( 2)
51293.7
|
8.21849e+06
Index:
SYSIBM
SQL110801091540160
收起