Documente Academic
Documente Profesional
Documente Cultură
Planning for
SQL Server 2012
Indexing
Module Overview
Core Indexing Concepts
Data Types and Indexes
Single Column and Composite Indexes
Index
Index Structures
Indexes are commonly based on tree structures
Not just a binary tree as nodes can have more than two
children
Top node is called the root node; bottom level nodes are
Density
Index Depth
Index Fragmentation
How does fragmentation occur?
Types of fragmentation:
Detecting fragmentation
index keys
values
keys
Problems arise
indexes
order
useful
SQL Server can start at either end and work towards the other
end
descending
Index Statistics
SQL Server needs to have knowledge of the layout of the
indexes
Can be disabled
Logon information
Virtual machine
10776A-MIA-SQL1
User name
AdventureWorks\Administrator
Password
Pa$$w0rd
Lab Scenario
You have been asked to explain the concept of index
statistics and selectivity to a new developer. You will explore
the statistics available on an existing index and determine
how selective some sample queries would be.
One of the company developers has provided you with a list
of the most important queries that will be executed by the
new marketing management system. Depending upon how
much time you have available, you need to determine the
best column orders for indexes to support each query.
Complete as many as possible within the allocated time. In
later modules, you will consider how these indexes would
be implemented. Each query is to be considered in isolation
in this exercise.
Lab Review
Which types of queries would most likely lead to widely-