Showing posts with label Indexing. Show all posts
Showing posts with label Indexing. Show all posts

Saturday, November 21, 2015

Primary index

Primary index / Primary indexing / Clustered index / Clustering index / index sequential file




An index whose order of the entries is same as the order of the records in the database table file is called as primary index. It can also be referred as clustering index, or clustered index.

Primary or clustering index’s search key is often the primary key of the table. It is not compulsory to have primary key attribute as the primary index’s search key. We can have other attributes as well.

Points to know about primary index:


  • A Primary Index forces a sequential file organization on the Data File;

  • Since a Data File can have just one order there can be just one Primary Index for Data File

  • The combination of a sequentially ordered file plus a clustering index is an index-sequential file


Primary index example:


In this example, the left side table is the index table, and the right side is the Students table. The search key or the ordering key field in the index table is the register number of students, which is the primary key of the students table. Observe from the picture given below the order of both index and the data file are the same.

Primary index (dense) example




A primary index (clustering index or clustered index or index on sequential files) can be one of two of the following types;


 


Go back

Saturday, September 26, 2015

Database Index

Database Index / Define index in database / What is index? / Example of an index / Purpose of a database index


Index

An index is an auxiliary data structure that is used to find records that meet a selection condition. Index is used especially to speed up the selection process where a selection condition to be verified on records. Index works the same way as the indexes found in end of the pages of most of the books.

Some of the indexes that you might have used are,

  • Card catalog in libraries
  • Telephone directory
  • Book last page indexes

Example

Book last page index

We can easily observe from the above image about an index. Yes, it has certain properties;
Index is sorted
Each entry (ex. Basic operation 14) contains the page number along with it
All the index keys are listed.
This type of arrangement speeds up our process by directly giving us the page where the required data are available.

Indexes usually are of two broad types. They are;

You can click on "How to choose the type of index for your application" to know about applications where these types can fit.



Database Index - Hash Index

Hash Indexes

To be continued...




Go to Index main page

Database Index - Ordered Index

Ordered indexes / What is an ordered index? / Types of ordered index




Ordered indices

An index that is sorted and stored on its search key value is called as ordered index. For example, if you consider any book’s last page indexes, you would see that they are ordered on the topics. It makes us easy to visit the content related to the topic by searching in alphabetical order.
The ordering or sorting in ordered indices would mean two things;

  1. Ordering of the index – that is, the search key values that are stored as part of the index file is ordered.
  2. Ordering of the file in which the table or relation is stored – that is, the actual database records that are stored in a file in the same order as the index entries order.

The first one may be primary or secondary type indices (it depends on the ordering of the database file).
The second one is strictly a primary index.
A database file may have several indices depends on their requirements. These indices can be one of the following types;








Go to Index main page


Featured Content

Multiple choice questions in Natural Language Processing Home

MCQ in Natural Language Processing, Quiz questions with answers in NLP, Top interview questions in NLP with answers Multiple Choice Que...

All time most popular contents

data recovery