How does database indexing work

Your comment on this question:

Email me at this address if a comment is added after mine:Email me if a comment is added after mine

Privacy: Your email address will only be used for sending these notifications.

1 answer to this question.

Your answer

Your name to display (optional):

Email me at this address if my answer is selected or commented on:Email me if my answer is selected or commented on

Privacy: Your email address will only be used for sending these notifications.

0 votes

If you have a book about dogs and you want to find a piece of information about let's say Grey Hound, you could, of course, flip through all the pages of the book and find what you are looking for - but this of will be time-consuming and not very fast.

Another option is that, you could just go to the Index section of the book and then find what you are looking for by using the Name of the entity you are looking ( in this instance, Grey Hound) and also looking at the page number to quickly find what you are looking for.

In Database, the page number is referred to as a pointer which directs the database to the address on the disk where an entity is located. Using the same Grey Hound analogy, we could have something like this (“Grey Hound”, 0x38129) where 0x38129 is the address on the disk where the row data for Grey Hound is stored.

In short, an index is a data structure that stores the values for a specific column in a table so as to speed up query search.