oracle仅部分记录建立索引的方法
SQL> select * from students where (case when sex='F' then sex end)='M' 2 /未选定行
执行计划
----------------------------------------------------------
Plan hash value: 2152294204
-------------------------------------------------------------------------------
|> --------------------------------------------------------------------------------
| 0 | SELECT STATEMENT | | 3 | 375 | 2 (0)|00:00:01 |
| 1 | TABLE ACCESS BY INDEX ROWID| STUDENTS| 3 | 375 | 2 (0)|00:00:01 |
|* 2 | INDEX RANGE SCAN | FEMALEINDEX | 38 | | 1 (0)|00:00:01 |
--------------------------------------------------------------------------------
Predicate Information (identified by operation> ---------------------------------------------------
2 - access(CASE "SEX" WHEN 'F' THEN "SEX" END ='M')
Note
-----
- dynamic sampling used for this statement
统计信息
----------------------------------------------------------
11 recursive calls
0 db block gets
67 consistent gets
0 physical reads
0 redo> 375 bytes sent via SQL*Net to client
374 bytes received via SQL*Net from client
1 SQL*Net roundtrips to/from client
0 sorts (memory)
0 sorts (disk)
0 rows processed
页:
[1]