sybase字段索引问题
select STORAGE_ORG,SUPPLIER_ID from ASSET_CARD where STORAGE_ORG=1 这么写是没问题的INDEX_STORAGE_ORG 索引可以用上。
select STORAGE_ORG,SUPPLIER_ID from ASSET_CARD where SUPPLIER_ID=0 这么写是没问题的INDEX_SUPPLIER_ID 索引可以用上。
select STORAGE_ORG,SUPPLIER_ID from ASSET_CARD where STORAGE_ORG=1 and SUPPLIER_ID=0
这么写只有INDEX_STORAGE_ORG 索引用上,这两个是字段都是创建的唯一索引。为什么INDEX_SUPPLIER_ID没有看到。
QUERY PLAN FOR STATEMENT 1 (at line 1).
STEP 1
The type of query is EXECUTE.
Executing a previously cached statement (SSQL_ID = 1425165586).
QUERY PLAN FOR STATEMENT 1 (at line 1).
STEP 1
The type of query is SELECT.
1 operator(s) under root
|ROOT:EMIT Operator (VA = 1)
|
| |SCAN Operator (VA = 0)
| | FROM TABLE
| | ASSET_CARD
| | Index : INDEX_STORAGE_ORG
| | Forward Scan.
| | Positioning by key.
| | Keys are:
| | STORAGE_ORG ASC
| | Using I/O Size 8 Kbytes for index leaf pages.
| | With LRU Buffer Replacement Strategy for index leaf pages.
| | Using I/O Size 8 Kbytes for data pages.
| | With LRU Buffer Replacement Strategy for data pages.
Table: ASSET_CARD scan count 1, logical reads: (regular=169 apf=0 total=169), physical reads: (regular=0 apf=0 total=0), apf IOs used=0
Total writes for this command: 0