This section will take the reader through an explanation of what indexing is, how it relates to data integrity, and how it impacts performance.
Indexing is a method of optimizing database performance to boost the speed of database queries. Indexes are placed on column(s) in a table. Tables can have more than one index, but there tends to be an optimal number of indexes before indexes impair performance instead of helping it. The optimal number can vary depending on the table. This is why index tuning can be an art as well as a science. To properly index a table, you need an understanding of how to streamline the process of query results that are returned to a user.
It's good to plan out the indexing that you will need before adding data, if possible. When you add an index to an empty table, it adds it pretty much instantaneously. It can take quite a...