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?

Answers were Sorted based on User's Feedback



I have a table with 1 million records out of which 10,000 records are of unique records, then if I w..

Answer / thanjairajan@gmail.com

You Can use Bitmap Index. Because while no.of unique record is small than no.of total record, we can use bitmap index. i.e we can use bitmap index in low cardinality column.

For example a table contain name,address,sex column. in sex column may be two values. i.e male and female. so this distinct values small but no.of total records is high.

So in this situation we can use bitmap index.

Is This Answer Correct ?    9 Yes 0 No

I have a table with 1 million records out of which 10,000 records are of unique records, then if I w..

Answer / 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

More SQL PLSQL Interview Questions

What are the different dml commands in sql?

0 Answers  


how to include numeric values in sql statements? : Sql dba

0 Answers  


How to make a copy values from one column to another in sql?

0 Answers  


Hello All, Could any well write a query for the following scenario. Account(table name) No Name Amount 1 ABCD 2000.00 2 DEFG -2000.00 3 GHIJ 3000.50 4 JKLM 4000.00 5 MNOP 6000.00 O/p Should be in this format No Name Credit Debit 1 ABCD 2000.00 0 2 DEFG 0 -2000.00 3 GHIJ 3000.50 4 JKLM 0 -4000.00 5 MNOP 6000.00 o could any one give appropriate query for this Thnks in Advance

5 Answers   Target,


Can we insert in view in sql?

0 Answers  






How to export the table data (this table having 18 million records) to .csv file. Please tell me is there any faster way to export the data.

8 Answers  


What is the result, when NULL is compared with NULL?

22 Answers   TCS,


Is it possible to pass parameters to triggers?

0 Answers  


How to handle bulk data?

0 Answers  


How many indexes can be created on a table in sql?

0 Answers  


How can you create Cursor with parametres ?

3 Answers  


how can we find the number of rows in a table using mysql? : Sql dba

0 Answers  


Categories