Indexing Fundamentals

Slides:



Advertisements
Similar presentations
Denny Cherry Manager of Information Systems MVP, MCSA, MCDBA, MCTS, MCITP.
Advertisements

EXECUTION PLANS By Nimesh Shah, Amit Bhawnani. Outline  What is execution plan  How are execution plans created  How to get an execution plan  Graphical.
10 Things Not To Do With SQL SQLBits 7. Some things you shouldn’t do.
Indexes Rose-Hulman Institute of Technology Curt Clifton.
Denny Cherry twitter.com/mrdenny.
Module 8 Improving Performance through Nonclustered Indexes.
Ashwani Roy Understanding Graphical Execution Plans Level 200.
SQL Server Indexes Indexes. Overview Indexes are used to help speed search results in a database. A careful use of indexes can greatly improve search.
Table Indexing for the.NET Developer Denny Cherry twitter.com/mrdenny.
Denny Cherry twitter.com/mrdenny.
Getting to Know SQL. © Jim Hope 2002 All Rights Reserved Data Manipulation SELECT statement INSERT INTO statement UPDATE statement DELETE statement TRANSFORM.
Microsoft AREC TAM Internship SQL Server Performance Tuning(I) Haijun Yang AREC SQL Support Team Feb, SQL Server 2000.
Denny Cherry twitter.com/mrdenny.
T-SQL: Simple Changes That Go a Long Way DAVE ingeniousSQL.com linkedin.com/in/ingenioussql.
DBA 328 Designing for Performance: Optimization with Indexes Kimberly L. Tripp Solid Quality Learning – SolidQualityLearning.com
Indexes and Views Unit 7.
SQL/Lesson 7/Slide 1 of 32 Implementing Indexes Objectives In this lesson, you will learn to: * Create a clustered index * Create a nonclustered index.
SQL SERVER DAYS 2011 Table Indexing for the.NET Developer Denny Cherry twitter.com/mrdenny.
Session 1 Module 1: Introduction to Data Integrity
Creating Indexes on Tables An index provides quick access to data in a table, based on the values in specified columns. A table can have more than one.
Indexing Fundamentals Steve Hood SimpleSQLServer.com.
Table Structures and Indexing. The concept of indexing If you were asked to search for the name “Adam Wilbert” in a phonebook, you would go directly to.
SQL SERVER DAYS 2011 Indexing Internals Denny Cherry twitter.com/mrdenny.
Indexes Part 2 What type of Indexes are there? Make sure you have the pages 2 & 3 of the Lab for Indexes in front of you before playing this presentation.
APRIL 13 th Introduction About me Duško Mirković 7 years of experience.
Data Integrity & Indexes / Session 1/ 1 of 37 Session 1 Module 1: Introduction to Data Integrity Module 2: Introduction to Indexes.
SQL IMPLEMENTATION & ADMINISTRATION Indexing & Views.
Chris Index Feng Shui Chris
Microsoft SQL Server 2005 Advanced SQL Programming and Optimization
Indexes By Adrienne Watt.
SQL Server Query and Index Tuning
© 2016, Mike Murach & Associates, Inc.
Accidental DBA Developer Edition
T-SQL: Simple Changes That Go a Long Way
Module 4: Creating and Tuning Indexes
Window function performance
The Top 5 SQL Server Mistakes
The Ins and Outs of Indexes
The Ins and Outs of Indexes
Getting To Know Your Indexes
The Key to the Database Engine
Lecturer: Mukhtar Mohamed Ali “Hakaale”
Table Indexing for the .NET Developer
Indexes … WHERE key = Table Index 22 Row pointer Key Indexes
Kerberos for SSRS made Simple
Execution Plans Demystified
Indexes: The Basics Kathi Kellenberger.
Chapter 4 Indexes.
The Ins and Outs of Indexes
CH 4 Indexes.
Kerberos for SSRS Made Simple
SQL Server Query Plans Journeyman and Beyond
T-SQL Window function deep dive part 2
Indexing for Beginners
Database systems Lecture 6 – Indexes
In Memory OLTP Not Just for OLTP.
CH 4 Indexes.
Kerberos for SSRS made Simple
Introduction to T-sql Window functionS
Index Tuning Additional knowledge.
Denny Cherry twitter.com/mrdenny
Execution plans Eugene
The Ins and Outs of Indexes
SQL Server Query Design and Optimization Recommendations
The Five Mistakes You are Probably Making with SQL Server
T-SQL Basics: Coding for performance
កម្មវិធីបង្រៀន SQL Programming ជាភាសាខ្មែរ Online SQL Training Course
All about Indexes Gail Shaw.
The Ins and Outs of Indexes
SQL Server Indexing for the Client Developer
Presentation transcript:

Indexing Fundamentals Kathi Kellenberger Kellenberger Consulting, LLC

Who am I? Teacher Author @auntkathi http://auntkathisql.com Beginning T-SQL Expert T-SQL Window Functions Beginning SSRS Consultant @auntkathi http://auntkathisql.com

The problem…. Our application is slow, and we don’t know why. We are seeing lots of timeouts. There is something wrong with our SQL Server; it used to be fast. We have indexes, but we don’t know if they are the right ones.

What they have tried Added processors Upgraded storage Added random indexes

Make SQL Server work less Table

Make SQL Server work less Index

Find My Number Game

Two types of tables Heaps Clustered Indexes

Heaps M S D X A T A

Clustered Index M D T A S X A D M S T X

Clustered Index M Non-Leaf Levels D T Contain the key A S X Leaf Level Contains the key other columns, and possibly a Uniquifier

Clustered Indexes Best Practices Narrow Unique Never changing Incrementing* Based on workload *Subject to debate

Two types of indexes Clustered Index Nonclustered Index

Nonclustered Index M Non-Leaf Levels D T Contain the key A S X Contains the key, Pointer to the table row, and included columns

Pointer to table row Clustered index – Cluster Key Heap – RID (row identifier)

Column order LastName FirstName City

Covering index

SARGability

SARGability Causes Function applied to column LIKE with leading wildcard (%) NOT LIKE No filter on leading column Implicit conversions

Nonclustered Index Best Practices Can add up to 999, but try to stay at 10 or less indexes per table Foreign keys Common WHERE clause columns Use workload to tune Filter before joining columns Take advantage of included columns