0% found this document useful (0 votes)
19 views18 pages

Final Group-Orcl

Uploaded by

tuongb2206021
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)
19 views18 pages

Final Group-Orcl

Uploaded by

tuongb2206021
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/ 18

INDEXES IN ORACLE

INSTRUCTOR: TRẦN CÔNG ÁN


CT208H - ORACLE DBMS

GROUP MEMBERS:
LÊ NHẬT BẰNG – B2205974
HUỲNH TÚ PHƯƠNG – B2206005
ĐẶNG NHẬT TƯỜNG – B2206021
LÂM THẾ VINH – B2206022
CONTENTS

01 DEFINITION

TYPES OF INDEX IN
02 ORACLE

Demonstrating the
03
Effect of Indexes
DEFINITION

 An index is a schema object in Oracle that improves the speed of data


retrieval operations on a database table at the cost of additional space
and maintenance overhead.
 Function:

• Provides a faster way to look up data in a table without scanning the


entire table .
• Similar to an index in a book, which allows you to quickly locate
information.
TYPES OF INDEX IN ORACLE

 B-Tree Index: Other


Normal indexes  Bitmap Indexes

Index-organized tables  Function-based Indexes

Reverse key indexes  Domain Indexes

Descending indexes
B-tree clustered indexes
B-Tree Index
Definition:
• A B-Tree (Balanced Tree) index is a type of data structure that maintains
sorted data in a way that allows for efficient insertion, deletion, and lookups.
• In Oracle, B-Tree indexes are implemented to optimize the retrieval of rows by
providing a fast path to the data stored in tables.

Structure:
• Internal Nodes: These nodes contain pointers to child nodes and keys that help
determine which branch of the tree to follow.
• Leaf Nodes: These nodes contain the actual indexed values (keys) and pointers
to the rows in the base table where the corresponding data resides.
Branch
Blocks

Leaf
Blocks
B-Tree Index
Use case
• A B-Tree index enhances database search performance by enabling quick
lookups on specific columns and reducing full table scans.

Benefits of B-Tree Indexes


• Fast Search Operations: B-Tree indexes allow for O(log n) search times,
significantly speeding up query performance.
• Balanced Structure: B-Trees maintain a balanced structure, ensuring consistent
performance even as data grows.

QUERY
Function-Based Index
Definition
• It is an index that calculates the result of a function involving one or more table
columns (an arithmetic expression, an SQL function, a PL/SQL function, or a
package function).

Use case
• Allows indexing on expressions or functions, which can improve performance for
queries involving those expressions.

Benefits of Function-Based Indexes:


• Enhanced Index Range Scans
• Advanced Sorting Capabilities
• Flexibility in Indexing
Bitmap Index
Definition:
• uses bitmaps (binary representations) to record the presence of distinct values
across rows. Each distinct value in a column is represented by a separate
bitmap. Each bit in the bitmap corresponds to a row in the table, with the bit
set to 1 if the row contains that value, and 0 otherwise.

Structure:
• Bitmap indexes use bitmaps (arrays of bits) to represent the presence of a value
in a column. Each bit in the bitmap corresponds to a row in the table.
Use Cases:
• Bitmap indexes are particularly effective for columns with low cardinality (few
distinct values), such as gender or status fields.
Bitmap Index

QUERY
Domain Index
Definition
• An application domain index is custom to a specific application. This
accommodates indexes on custom data types, documents images, video, and
spatial data.

Use case
• When you need to optimize searches for specialized data not supported by default
indexes.

Benefits of Domain Indexes:


• Improved Query Performance
• Enhanced Search Capabilities
Demonstrating the Effect of Indexes

We create 2 tables and


insert 1.000.000 rows
into the test_normal
table
We have 1.000.000 rows data in
test _ normal table
Test without Index

Result:
Before using an index, the CPU cost
for the query was 1713. Time is 21s
Test with Index Create
index

Result:
After using an index, the CPU cost
for the query was drop 4. Time is 1s
CONCLUSION
This report highlights the significant impact of using indexes on
optimizing data queries in Oracle. Key observations include:

Impact of Indexes
Query Performance
Optimization Considerations
Recommendations
Future Directions
REFERENCES

[1] ORACLE - Indexes and Index-Organized


Tables

[2] Oracle Index: REATE, DROP, RENAME –


Guide with Examples, DBForge Team

[3] SQL Indexing and Tuning e-Book

You might also like