SQL: What Is An Index

This is a basic topic on SQL performance tuning:

Simply put, an index is a pointer to data in a table. An index in a database is similar to an index in the back of a book. For example, if you want to reference all pages in a book that discuss a certain topic, you first refer to the index, which lists all topics alphabetically, and it refers you to one or more specific page numbers.

An index in a database works the same way in that a query is pointed to the exact physical location of data in a table.

You are actually being directed to the data’s location in an underlying file of the database, but as far as you are concerned, you are referring to a table. Which would be faster, looking through a book page by page for some information or searching the book’s index and getting a page number?

Of course, using the book’s index is the most efficient method. It can save a lot of time, especially if the book is large.

If you have a book of just a few pages, however, it might be faster to check the pages for the information than to flip back and forth between the index and pages of the book. When a database does not use an index, it is performing what is typically.

Also read

Author: Srini

Experienced software developer. Skills in Development, Coding, Testing and Debugging. Good Data analytic skills (Data Warehousing and BI). Also skills in Mainframe.

Comments are closed.