Chris Shaw CShaw@Xtivia.com @SQLShaw Index Feng Shui Chris Shaw CShaw@Xtivia.com @SQLShaw.

Slides:



Advertisements
Similar presentations
Understanding SQL Server Query Execution Plans
Advertisements

Module 3: Creating and Tuning Indexes. Planning Indexes Creating Indexes Optimizing Indexes.
Denny Cherry Manager of Information Systems MVP, MCSA, MCDBA, MCTS, MCITP.
EXECUTION PLANS By Nimesh Shah, Amit Bhawnani. Outline  What is execution plan  How are execution plans created  How to get an execution plan  Graphical.
Working with SQL Server Database Objects
Module 6 Implementing Table Structures in SQL Server ®2008 R2.
A HEAP OF CLUSTERS A look into heaps vs. clustered tables Ami Levin CTO, DBSophic X.
SQL Server Storage and Index Structures Physical Data Organization Indexes B-Trees SQL Server Data Access Clustered and Non-Clustered Creating, Altering,
Denny Cherry twitter.com/mrdenny.
Performing Indexing and Full-Text Searching Lesson 21.
Module 8 Improving Performance through Nonclustered Indexes.
Oracle9i Database Administrator: Implementation and Administration 1 Chapter 9 Index Management.
TEMPDB Capacity Planning. Indexing Advantages – Increases performance – SQL server do not have to search all the rows. – Performance, Concurrency, Required.
Denny Cherry Manager of Information Systems MVP, MCSA, MCDBA, MCTS, MCITP.
Ashwani Roy Understanding Graphical Execution Plans Level 200.
Module 5 Planning for SQL Server® 2008 R2 Indexing.
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.
Effective Indexes For Beginners. Performance is slow Let’s add another index!
Denny Cherry twitter.com/mrdenny.
Indexes / Session 2/ 1 of 36 Session 2 Module 3: Types of Indexes Module 4: Maintaining Indexes.
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.
SQLintersection Putting the "Squeeze" on Large Tables Improve Performance and Save Space with Data Compression Justin Randall Tuesday,
SQL SERVER DAYS 2011 Table Indexing for the.NET Developer Denny Cherry twitter.com/mrdenny.
Chapter 4 Indexes. Index Architecture  By default data is inserted on a first-come, first-serve basis  Indexes bring order to this chaos  Once you.
Analysing Indexes SQLBits 6 th October 2007 © Colin Leversuch-Roberts Kelem Consulting Limited September 2007.
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.
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.
ACCESS CHAPTER 2 Introduction to ACCESS Learning Objectives: Understand ACCESS icons. Use ACCESS objects, including tables, queries, forms, and reports.
October 1-2 Ølensvåg. Hardcore SQL Session Code: SQL-401-Hardcore Speaker(s): Vidar Nordnes.
How to kill SQL Server Performance Håkan Winther.
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.
October 15-18, 2013 Charlotte, NC SQL Server Index Internals Tim Chapman Premier Field Engineer.
Scott Fallen Sales Engineer, SQL Sentry Blog: scottfallen.blogspot.com.
Module 6: Creating and Maintaining Indexes. Overview Creating Indexes Understanding Index Creation Options Maintaining Indexes Introducing Statistics.
Diving into Query Execution Plans ED POLLACK AUTOTASK CORPORATION DATABASE OPTIMIZATION ENGINEER.
Data Integrity & Indexes / Session 1/ 1 of 37 Session 1 Module 1: Introduction to Data Integrity Module 2: Introduction to Indexes.
Tips for SQL Server Performance and Resiliency
How Good Is Your Indexing Strategy?
SQL Server Query and Index Tuning
Indexing ? Why ? Need to locate the actual records on disk without having to read the entire table into memory.
Finding more space for your tight environment
Inside of SQL Server Indexes
Module 4: Creating and Tuning Indexes
Database Applications (15-415) DBMS Internals- Part III Lecture 15, March 11, 2018 Mohammad Hammoud.
Marcos Freccia Stop everything! Top T-SQL tricks to a developer
ISC440: Web Programming 2 Server-side Scripting PHP 3
The Ins and Outs of Indexes
Getting To Know Your Indexes
Table Indexing for the .NET Developer
Physical Join Operators
Session #, Speaker Name Indexing Chapter 8 11/19/2018.
20 Questions with Azure SQL Data Warehouse
Execution Plans Demystified
Indexes: The Basics Kathi Kellenberger.
The Ins and Outs of Indexes
SQL Server Query Plans Journeyman and Beyond
Database systems Lecture 6 – Indexes
Indexing For Optimal Performance
Weird Stuff I Saw While … Working With Heaps
Clustered Columnstore Indexes (SQL Server 2014)
The Ins and Outs of Indexes
Diving into Query Execution Plans
Using Columnstore indexes in Azure DevOps Services. Lessons learned
Using Columnstore indexes in Azure DevOps Services. Lessons learned
The Ins and Outs of Indexes
SQL Server Indexing for the Client Developer
XML? What’s this doing in my database? Adam Koehler
Presentation transcript:

Chris Shaw CShaw@Xtivia.com @SQLShaw Index Feng Shui Chris Shaw CShaw@Xtivia.com @SQLShaw

Rules of the Dojo Stop me and ask questions. If it takes to long we may need to take it to a side bar. Feel free to e-mail me Cshaw@xtivia.com. Scripts can be downloaded from my blog.

Sensei (About) CShaw@Xtivia.com 6 SQL Server MVP Awards @SQLShaw http://chrisshaw.wordpress.com 6 SQL Server MVP Awards 17 years of experience

Expectations Use this session as a launching pad. There is a lot of information in here, and we don’t have time to cover all of it.

What is an index Think of a book, if you are looking for Brain Surgery in a Medical book, where do you find the information you need? Could the page numbers be considered an index? Is the table of contents in the front of the book considered an index? What if there wasn’t an index or a TOC? How long would that take? Think about your MP3 player, is that an index?

B-tree Root Intermediate Leaf

Primary Index Types Heap Clustered Indexes Non-Clustered Indexes A Table without a clustered index Clustered Indexes All the data in sorted in the Leaf Node Non-Clustered Indexes Contains rows identified in the index other data is retrieved by a lookup.

Leaf Node Heap Clustered Indexes Non-Clustered Indexes

Leaf Node Heap Clustered Indexes Non-Clustered Indexes

Index Types and Strategies Column Store New in 2012 Modified in 2014 Covering All the data you need is in the index Filtered Ability to remove rows that are not needed

Column Store Ideal for OLAP databases New Index type in SQL Server 2012 Enterprise Edition Non-Updateable SQL Server 2014 Updateable

Column Store Data is stored by column not by row Data is non-clustered Data is non-Unique

Covering Indexes Most often used to match specific Queries. Select [Name], [City], [State], [Cell], [Email] From Customers Allows the index to return all required data without additional I/O Big increase in performance Easy to overuse

Covering Indexes

Filtered Indexes Allow indexing of only relevant data. ex. Index only non-null data Improves Maintenance Performance Improved Storage Improved Query Plans

Additional Index Terms Selectivity The unique quality of data in a row Fill Factors The percentage of data on a page 80% fill factor leaves 20% free space 0 and 100 % are the same or are they? Page Splits Seeks Optimal use of the index Scans (RBAR) Analyzing each row.

Common Indexing Issues Not being maintained - Index is there just fragmented As a table grows the search's slow Demo - Fragmented Indexes To much maintenance Not enough Indexes Slow Searches Demo - Missing Indexes To Many Indexes - When indexes hurt. Slow Insert Statements Demo - Demo Index Usage Indexes that get you only half way there. Book Mark Lookups

Entering the Zen Best decisions are made with complete information. Gather information using: DMV's Query Plans Performance Monitor Statistics IO Showplan_All

Demo

Maintenance Maintenance Plans Difference between rebuild and re-organize?

Index FAQ Is the PK required to be clustered? What about Statistics? How Often should I re-index. What about online re-indexing?

Thank You Questions Cshaw@Xtivia.com @SQLShaw