We are living on the planet with the seven billion population.Each and every human being’s have some information. Data is an important factor in the business’s world. Every day in business’s operation we deal with data. It can be structure and un-structure data. All the report of business prepare with the help of data. We take a quick review on how data is really matters on a drill. Data of Railways, Healthcare, Education, Real state, Banking, Entertainment industries, research and development etc. plays an important role in the development of a country. To manage data in a bulk amount technical market provide some better solutions to the organization. With the help of best solutions, an organization can preserve its treasure(DATA). Due to the bulk amount of data in any organization. It is laborious for users.
What is Index?
The index is a database structure which is used to improves the speed of data retrieval operations on a database table the cost of additional writes and storage space to maintain the index data structure.
Advantages of the index are mention below:-
- Indexes make search queries much faster.
- It helps to make a row unique or without duplicates(primary, unique) .
- They can be used for sorting. A post-fetch-sort operation can be eliminated.
- An index is a physical structure contains pointers to the data.
- An index allows the program to find the specific data in a table without scanning the entire table.
- An index can be used to avoid sorting the results during execution of the query.
- To pre-materialize a sort over the data.
- To enable singleton lookups (seeks) for particular values.
- To reduce locking requirements caused by scans.
Disadvantages of the index are mention below:-
- Indexes take additional disk space.
- Indexes slow down INSERT, UPDATE and DELETE, but will speed up UPDATE if the WHERE condition has an indexed field. INSERT, UPDATE and DELETE becomes slower because on each operation the indexes must also be updated.
Keep some points in mind while creating the index.
- Primary and unique keys automatically have indexes, but you might want to create an index on a foreign key.
- Index columns used for joins to improve performance on joins of multiple tables.
- Create an index if you frequently want to retrieve less than 15% of the rows in a large table.
- Small tables do not require indexes.
Types of Index in Oracle
|By default best for columns with high cardinality.
|It is efficient when most of the column values are included in the primary key.
|A form of B-tree index; used to enforce uniqueness in column values; often used with primary key and unique key constraints but can be created independently of constraints.
|A form of B-tree index; useful for balancing I/O in an index that has many sequential inserts.
|Good for concatenated indexes in which the leading column in often repeated ; compresses leaf block entries; applies to B-tree and IOT indexes.
|A form of B-tree index; used with indexes in which corresponding column vaues are sorted in a descending order but by default ascending.
|Excellent in data warehouse environments with low cardinality columns and SQL statements using many AND or OR operators in the WHERE clause. Bitmap index are not appropriate for OLTP database in which rows are frequently updated. you can create unique bitmap index.
|Useful in data warehouse enviorments for queries that use star schema structures that join fact and dimension tables.
|Good for column that have SQL functions applied to them; can be used with either a B-tree or bitmap index.
|Indexed virtual column
|An index defined on a virtual column (of a table); useful for columns that have SQL funcations applied to him ; a viable alternative to a function based index.
|Allows you to create an index with no physical segment or extents via the NOSEGMENT clause of CREATE INDEX; useful in tuning SQL without consuming resouces required to build the physical index. Any index type can be created as virtual.
|The index is not visible to the query optimizer. However , the structure of the index is maintained as table data are motdified . Useful for the testing an index before making visible to the application. Any index type can be created as invisible. Any type of index can be invisible.
|Global index across all partitions in a partitioned or regular table; can be a B-tree index type and can’t be a bitmap index type.
|Local index based on individual partitions in a partitioned table; can be either a B-tree or bitmap index type.
|Specific for an application or cartridge.
|Used with clustered tables.
|Used with hash clusters.
|A form of B-tree index ; used for balancing I/O in an index that has many sequential inserts.