Sie sind auf Seite 1von 1

Index is a db object that makes data retrieval faster

index is created on column and the column is called a index key


Types:
1. Btree
2. Bitmap

leaf nodes are called data nodes . Every data node contains a value called index
key
and a star called row-id i.e address of the record
non-leaf nodes are called index nodes
Every index node contains a left pointer a value and a right pointer

emp
sal
5000
1000
2500
3000
1500
3000
4000
2000

select * from emp where sal>3000;


create index i1 on emp(sal);

Indexes are used to quickly locate data without having to search every row
in a database table every time a database table is accessed.
Indexes can be created using one or more columns of a database table,
providing the basis for both rapid random lookups and efficient access
of ordered records.

CREATE INDEX ord_customer_ix


ON orders (customer_id);

Function Based Index :


CREATE INDEX income_ix
ON employees(salary + (salary*commission_pct));

Partition Based Index:


CREATE INDEX cost_ix ON sales (amount_sold)
GLOBAL PARTITION BY RANGE (amount_sold)
(PARTITION p1 VALUES LESS THAN (1000),
PARTITION p2 VALUES LESS THAN (2500),
PARTITION p3 VALUES LESS THAN (MAXVALUE));

Das könnte Ihnen auch gefallen