We often hear that you should always have clustered indexes on your tables. What's left off of this discussion is the how to choose the columns for this index. Should it be the primary key? Or some other column or set of columns? Having the wrong key column(s) in the clustered index can lead to performance problems, possibly worse than having no clustered index on the table at all. In this session, we'll review common patterns for selecting clustered indexes and how to determine which pattern you need. Also, we'll look at how to analyze tables to help select the best clustered index for every table.
http://www.jasonstrate.com/go/20131010-IX/
3. About Pragmatic Works
•
•
•
•
•
•
•
Industry leaders in Microsoft BI and SQL Server
Platform
SQL Server Professionals - PASS Board of Directors,
Speakers, Authors and MVP’s
National Sales Team Divided by Microsoft
Territories
National System Integrator (NSI)
Gold Certified in Business Intelligence and Data
Platform
Platform Modernization/Safe Passage
Premier Partner for PDW SI Partner Program
MS PDW Partner of Year FY13
Frontline Partnership Partner of the Year for Big Data
Executive sponsor - Andy Mouacdie, WW sales director
PDW
•
•
Over 7,200 customers worldwide
Over 186,000 people in PW database for demand
generation
MAKING BUSINESS INTELLIGENT
www.pragmaticworks.com
35. Identity Column
• Non-related value that defines each row
uniquely
• Assigned when data is inserted
• Typically uses:
– Int or bigint
– IDENTITY or SEQUENCE
MAKING BUSINESS INTELLIGENT
www.pragmaticworks.com
38. Surrogate Key
•
•
•
•
Unique value is a part of the row
Assigned in the source data
Data type dependent on the data
Value should be unchanging
– Employee ID
– Social Security Number
– Birthdate
MAKING BUSINESS INTELLIGENT
www.pragmaticworks.com
41. Foreign Key
• One-to-many relationships
• Access path in child via parent
• Piggy-backs identity pattern
– Parent left of child identity value
• Common in many applications
– Order header to details
– Hotels to rooms
MAKING BUSINESS INTELLIGENT
www.pragmaticworks.com
44. Multi-Column
•
•
•
•
Similar to foreign key pattern
Many-to-many relationships
Highly dependent on selectivity
NOT a collection of dimension keys
MAKING BUSINESS INTELLIGENT
www.pragmaticworks.com
47. Globally Unique Identifier
• Non-related value that defines each row
uniquely
• Assigned when data is inserted
– Or from the application
• Typically uses:
– uniqueidentifier
– NEWID() or NEWSEQUENTIALID()
MAKING BUSINESS INTELLIGENT
www.pragmaticworks.com
52. Summary
• Clustered indexes are important
• Select clustering keys based on need
• Validate clustered indexes over time
MAKING BUSINESS INTELLIGENT
www.pragmaticworks.com
53. More Information
Expert Performance Indexing
For SQL Server 2012
Jason Strate
Ted Krueger
Overview
Statistics
Maintenance
Tools
Analysis
http://amzn.com/1430237414
MAKING BUSINESS INTELLIGENT
www.pragmaticworks.com
54. For more information…
Name: Jason Strate
Email: jstrate@pragmaticworks.com
Blog: www.jasonstrate.com
Resource: jasonstrate.com/go/indexing
Products
BI products to covert to a Microsoft BI
platform and simplify development on
the platform.
Services
Speed development through training, and
rapid development services from
Pragmatic Works.
Foundation
Helping those who do not have the
means to get into information technology
achieve their dreams.