|
Indexes are important. Not only that, they are vastly important. No single structure aids in retrieving data from a
database more than an index. Indexes represent both how data is stored and the access paths by which data can
be retrieved from your database. Without indexes, a database is an unordered mess minus the roadmap to find
the information you seek.
Throughout my experience with customers, one of the most common resolutions that I provide for
performance tuning and application outages is to add indexes to their databases. Often, the effort of adding an
index or two to the primary tables within a database provides significant performance improvements—much
more so than tuning the database on statement. This is because an index can affect the many SQL statements that
are being run against the database.
Managing indexes may seem like an easy task. Unfortunately, their seeming simplicity is often the key
to why they are overlooked. Often there is an assumption from developers that the database administrators
will take care of indexing. Or there is an assumption by the database administrators that the developers are
building the necessary indexes as they develop features in their applications. While these are primarily cases of
miscommunication, people need to know how to determine what indexes are necessary and the value of those
indexes. This book provides that information.
Outside of the aforementioned scenarios is the fact that applications and how they are used changes over
time. Features created and used to tune the database may not be as useful as expected, or a small change may
lead to a big change in how the application and underlying database are used. All of this change affects the
database and what needs to be accessed. As time goes on, databases and their indexes need to be reviewed to
determine if the current indexing is accurate for the new load. This book also provides information in this regard.
From beginning to end, this book provides information that can take you from an indexing novice to an
indexing expert. The chapters are laid out such that you can start at any place to fill in the gaps in your knowledge
and build out from there. Whether you need to understand the fundamentals or you need to start building out
indexes, the information is available here.
Chapter 1 covers index fundamentals. It lays the ground work for all of the following chapters. This chapter
provides information regarding the types of indexes available in SQL Server. It covers some of the primary index
types and defines what these are and how to build them. The chapter also explores the options available that can
change the structure of indexes. From fill factor to included columns, the available attributes are defined and
explained.
Chapter 2 picks up where the previous chapter left off. Going beyond defining the indexes available, the
chapter looks at the physical structure of indexes and the components that make up indexes. This internal
understanding of indexes provides the basis for grasping why indexes behave in certain ways in certain
situations. As you examine the physical structures of indexes, you’ll become familiar with the tools you can use to
begin digging into these structures on your own.
Armed with an understanding of the indexes available and how they are built, Chapter 3 explores the
statistics that are stored on the indexes and how to use this information; these statistics provide insight into
how SQL Server is utilizing indexes. The chapter also provides information necessary to decipher why an index
may not be selected and why it is behaving in a certain way. You will gain a deeper understanding of how this
information is collected by SQL Server through dynamic management views and what data is worthwhile to
review. |