I have a table with 1 million records out of which 10,000 records are of unique records, then if I will implement index, then which type of index shall I use and why shall I use?

Answer Posted / mrityunjay singh

Fully indexing a large table with a traditional B-tree index can be prohibitively expensive in terms of disk space because the indexes can be several times larger than the data in the table. Bitmap indexes are typically only a fraction of the size of the indexed data in the table.

An index provides pointers to the rows in a table that contain a given key value. A regular index stores a list of rowids for each key corresponding to the rows with that key value. In a bitmap index, a bitmap for each key value replaces 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. A mapping function converts the bit position to an actual rowid, so that the bitmap index provides the same functionality as a regular index. Bitmap indexes store the bitmaps in a compressed way. If the number of distinct key values is small, bitmap indexes compress better and the space saving benefit compared to a B-tree index becomes even better.

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is sqlite used for?

699


what does myisamchk do? : Sql dba

742


Is it possible to create startup or shutdown trigger for on-schema?

780


What are the advantages of normalization?

788


What does partition by mean in sql?

690






What is mutating sql table?

826


what is self join and what is the requirement of self join? : Sql dba

859


what are null values? : Sql dba

708


What is sqlexception in java?

732


Is it possible for a table to have more than one foreign key?

774


What is sql injection owasp?

727


How do I find sql profiler?

683


How to get unique records from a table?

684


What is the difference between rename and alias?

972


What is the difference between clustered and non-clustered index in sql?

733