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
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 |
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 |
what does it mean to have quoted_identifier on? : Sql dba
how to sort records in sql?
What is the best strategy to use COMMIT in a pl/sql loop?
Can a foreign key be null?
What is the different between Stored Procedure and Procedure?
What is the difference between truncate and drop statements?
How many rows will return from dual table?
What is function and procedure in pl sql?
how will u find statistics of a database objects?
How to add a column ‘salary’ to a table employee_details?
What is the use of non clustered index?
how to eliminate null values in a column i.e table vlaues 1 2 3 NULL 3 4 1 5 NULL i want output like this 1 2 3 3 4 1 5 i dnt want to use nvl is null and i dnt want replace the NULL value with any value i.e nvl(col,o);