1 File Structure & Organization
1 File Structure & Organization
Application program
O.S
Primary Index
Primary Index is an ordered file which is fixed length size with two fields. The first field is
the same a primary key and second, filed is pointed to that specific data block. In the primary
Index, there is always one to one relationship between the entries in the index table. The
primary Indexing in DBMS is also further divided into two types.
Dense Index
Sparse Index
Dense Index
In a dense index, a record is created for every search key valued in the database. This
helps you to search faster but needs more space to store index records. In this Indexing,
method records contain search key value and points to the real record on the disk.
• Primary Index − Primary index is defined on an
ordered data file. The data file is ordered on a key
field. The key field is generally the primary key of
the relation.
. Secondary Index − Secondary index may be
generated from a field which is a candidate key and
has a unique value in every record, or a non-key
with duplicate values.
• Clustering Index − Clustering index is defined on
an ordered data file. The data file is ordered on a
non-key field.
Primary Index are two types:-
• Sparse Index
• Dense Index
• Dense Index:_
There is an index record for every search key value in the
database. This makes searching faster but requires more
space to store index records itself. Index records contain
search key value and a pointer to the actual record on the
disk.
• Sparse Index
In index records are not created for every search key. An index
record here contains a search key and an actual pointer to the data
on the disk. To search a record, we first proceed by index record
and reach at the actual location of the data. If the data we are
looking for is not where we directly reach by following the index,
then the system starts sequential.