0% found this document useful (0 votes)
23 views6 pages

Index Management

This document discusses different types of indexes that can be created in a database including simple, composite, unique, reversing, function based, and bitmap indexes. It provides examples of creating each type of index and explains their uses and benefits.

Uploaded by

iqra
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
23 views6 pages

Index Management

This document discusses different types of indexes that can be created in a database including simple, composite, unique, reversing, function based, and bitmap indexes. It provides examples of creating each type of index and explains their uses and benefits.

Uploaded by

iqra
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 6

Index Management

Database Administration and Management


Need of Index
When we run query (Select marks from student where marks <33);
OR
When we run query (Select sale from employee where salary <5000);
 Frequently verifying conditions
 Frequently assessing
 Assessing multiple records
Index
 Index maintains column data in ascending order
 It also maintain addresses
Why we use Index
 Decrease no. of verification
 Save time
 Better performance
Example

Roll_No Name Marks Address Roll_No Marks

1 Ali 45 BWP 5 22

2 Usama 87 LHR 6 30

3 Usman 48 BWP 1 45

4 Ahmed 64 BWP 3 48

5 Amir 22 BWP 4 64

6 Umer 30 LHR 2 87
Types of Index
 Simple Index
 Composite Index
 Unique Index
 Reversing Index
 Function based Index
 Bitmap Index

Simple Index
 Index create on single column. e.g., sale from employee table ,marks from student
table, etc.
Query
 Create INDEX IDX_SALARY on employee(sale);
 Searching in index, not table
Composite Index
 Index creates on multiple columns on any table.
Query
 Create INDEX idx_s.no_rollNo on students(s.no, rollNo);

Unique Index
 Index creates on columns ----- no duplication
Query
 Create UNIQUE INDEX idx_mobileNo on customers_dtls(mobile);

Reversing Index
 Want to search data frequently looking for highest value.
 Normally List values------- beginning, Highest value---------ending
 Its searching is fast because its work in reversing order.
 Based on Binary tree.------ right to left in b.tree.
 Create INDEX idx_sales_amt on sales(sales_amt) REVERSE;
Function based index
 Work on function based.
 Suppose I have a table of employee, and have a column of emp_id,salary,commission
Query
 Select e_id,sal(0.100*sal) from emp
 Create Index idx_sal on emp(sal(0.100*sal))init cap(ename);

Bitmap index
 Bits --------- 0,1
 Less number of values in columns
 E.g.,
 status--active/inactive,
 Gender--male/female
Query
 Create bitmap Index id_gender on customer(gender);
Note:
 All index created based on the binary tree index.

You might also like