which type of index should be created to spread the distribution of index
updates across the index tree?
a.b-tree indexes
b.bitmap indexes
c.reverse-key indexes
d.function-based indexes
ANSWERC
BECAUSE:
Classification of Indexes
? Logical
– Single column or concatenated
– Unique or nonunique
– Function-based
A function-based index is created when using functions or expressions that involve
one or more columns in the table being indexed. A function-based index precomputes
the value of the function or expression and stores it in the index. Function-based
indexes can be created as either a B-tree or a bitmap index.
? Physical
– Partitioned or nonpartitioned
– B-tree
At the top of the index is the root, which contains entries that point to the next level in
the index. At the next level are branch blocks, which in turn point to blocks at the next
level in the index. At the lowest level are the leaf nodes, which contain the index
entries that point to rows in the table. The leaf blocks are doubly linked to facilitate
scanning the index in an ascending as well as descending order of key values.
– Normal or reverse key
In contrast to a regular B-tree index, a reverse key index reverses the bytes of each
column indexed (except the ROWID) while keeping the column order. When inserting
records on an ascending key, such as a system-generated employee number, I/O
bottlenecks can occur on the index because all index updates occur at the same place
in the index tree. Reverse key indexes spread the distribution of index updates across
the index tree by reversing the data value of the index key.
– Bitmap
A bitmap index is also organized as a B-tree, but the leaf node stores a bitmap for each
key value instead of a list of ROWIDS. Each bit in the bitmap corresponds to a
possible ROWID, and if the bit is set, it means that the row with the corresponding
ROWID contains the key value.
Bitmap indexes are more advantageous than B-tree indexes in certain situations:
? When a table has millions of rows and the key columns have low cardinality—that
is, there are very few distinct values for the column. For example, bitmap indexes
may be preferable to B-tree indexes for the gender and marital status columns of a
table containing passport records.
? When queries often use a combination of multiple WHERE conditions involving
the OR operator.
? When there is read-only or low update activity on the key columns.
|