Database Reference
In-Depth Information
Execution Plan
----------------------------------------------------------
Plan hash value: 320981916
----------------------------------------------------------------------------------------
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| ...
----------------------------------------------------------------------------------------
| 0 | SELECT STATEMENT | | 1 | 13 | 9 (0)| ...
| 1 | SORT AGGREGATE | | 1 | 13 | | ...
| 2 | BITMAP CONVERSION COUNT | | 608 | 7904 | 9 (0)| ...
| 3 | BITMAP AND | | | | | ...
| 4 | BITMAP OR | | | | | ...
|* 5 | BITMAP INDEX SINGLE VALUE| LOCATION_IDX | | | | ...
|* 6 | BITMAP INDEX SINGLE VALUE| LOCATION_IDX | | | | ...
|* 7 | BITMAP INDEX SINGLE VALUE| LOCATION_IDX | | | | ...
|* 8 | BITMAP INDEX SINGLE VALUE | AGE_GROUP_IDX | | | | ...
|* 9 | BITMAP INDEX SINGLE VALUE | GENDER_IDX | | | | ...
----------------------------------------------------------------------------------------
Predicate Information (identified by operation id):
---------------------------------------------------
5 - access("LOCATION"=1)
6 - access("LOCATION"=10)
7 - access("LOCATION"=30)
8 - access("AGE_GROUP"='41 and over')
9 - access("GENDER"='M')
This example shows the power of the bitmap indexes. Oracle is able to see the location in (1,10,30) and knows to
read the index on location for these three values and logically OR together the “bits” in the bitmap. It then takes that
resulting bitmap and logically ANDs that with the bitmaps for AGE_GROUP='41 AND OVER' and GENDER='M' . Then a
simple count of 1s and the answer is ready.
EODA@ORA12CR1> select *
2 from t
3 where ( ( gender = 'M' and location = 20 )
4 or ( gender = 'F' and location = 22 ))
5 and age_group = '18 and under';
Execution Plan
----------------------------------------------------------
Plan hash value: 705811684
 
Search WWH ::




Custom Search