Sunday, 27 September 2015

CHAR AND VARCHAR2 DIFFERENCE AND Bitmap Indexes

CHAR AND VARCHAR2 DIFFERENCE:

 When we use char(10) and inserting only the character 7 as 'Vijayan' oracle automatically would append the blank space at the end of the line. Varchar2 would insert the values exactly the length of the value.

Bitmap Indexes:

B-tree indexes are virtually useless on low-cardinality columns (columns with only a few distinct values). By the time 4% or more of a table is read via an index, it would be faster to perform a full table scan. Bitmap Indexes do not solve this problem in general, but they do solve a specific case. If a table contains 2 or more low-cardinality columns and they are used in combination in a SQL statement to reduce the number of rows returned, then bitmap indexes can perform faster than a full table scan.
Use bitmap indexes when:
A table has 2 or more low cardinality columns. Create a bitmap index on each column
Two or more bitmap indexed columns are used together in AND and OR conjunctions, using equals (=), IN, and NOT IN conditions.
The WHERE clauses on the bitmap indexed columns, when combined, reduce the rows returned to a small percentage of the table or partition.
The bitmap indexed table has low volatility (does not change much), or all updates are performed by a single session. Bitmap indexes on high volatility tables can cause locking problems.

No comments:

Post a Comment