sybase字段索引问题

shaoguangbing 2012-02-29 05:22:59
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
...全文
55 回复 打赏 收藏 转发到动态 举报
写回复
用AI写文章
回复
切换为时间正序
请发表友善的回复…
发表回复

17,082

社区成员

发帖
与我相关
我的任务
社区描述
Oracle开发相关技术讨论
社区管理员
  • 开发
  • Lucifer三思而后行
  • 卖水果的net
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧