Best practices for indexing
Indexing is a method of optimizing database performance by reducing the amount of disk usage when running a query against the database. 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 that you can have before indexes start hurting 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 to have a good understanding of how the data in the table is being used.
It's good to plan out the indexing that you will need in advance of adding data, if possible. When you add an index to a blank table, it adds it pretty ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access