- By RowID - Mapping column data to ROWIDs for the columns of interest.
- By Full Table Scan
B-Tree indexes
- Default and most common index type.
- Can be unique or non-unique and either simple (one column) or concatenated (multi cols).
- Provides best performance on high cardinality (many distinct values) columns.
- Offer methods to retrieve small number of interesting rows.
- Can be used if any combination of the leading columns of the index are used in the SQL. For ex - The OE.INVENTORIES table has the index INVENTORY_PK on the PRODUCT_ID (leading) and WAREHOUSE_ID columns. We can use this INVENTORY_PK index with the following query:
PRODUCT_ID = 3191 and warehouse_id = 3;
Following will also use index as PRODUCT_ID is leading column in INDEX.
SELECT SUM(quantity_on_hand) FROM oe.inventories WHERE
PRODUCT_ID = 3191
But below will not use index as WAREHOUS_ID is not leading column
SELECT SUM(quantity_on_hand) FROM oe.inventories WHERE
warehouse_id = 3;
Bitmap Indexes
- Primarily used for decision-support systems or static data, because they do not support row level locking.
- Like B-Tree indexes they can also be simple or concatenated.
- Best used for low or medium cardinality columns.
- Index is constructed by storing the bit-maps in the leaf nodes of a B-Tree structure. The B-Tree makes it easy to find the bitmaps of interest quickly.
- Bitmaps are stored in compressed format, so takes less disk space comparison to B-Tree index.
No comments:
Post a Comment