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

Slides:



Advertisements
Similar presentations
Denny Cherry twitter.com/mrdenny.
Advertisements

Tuning: overview Rewrite SQL (Leccotech)Leccotech Create Index Redefine Main memory structures (SGA in Oracle) Change the Block Size Materialized Views,
Presented By Akin S Walter-Johnson Ms Principal PeerLabs, Inc
Module 3: Creating and Tuning Indexes. Planning Indexes Creating Indexes Optimizing Indexes.
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.
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.
Working with SQL and PL/SQL/ Session 1 / 1 of 27 SQL Server Architecture.
Denny Cherry twitter.com/mrdenny.
Performing Indexing and Full-Text Searching Lesson 21.
With Michelle Ufford.  Sr. DBA for GoDaddy.com  Working with SQL for 6 years, focused on performance tuning and VLDB’s  Member of the PASS Performance.
TEMPDB Capacity Planning. Indexing Advantages – Increases performance – SQL server do not have to search all the rows. – Performance, Concurrency, Required.
INFO 344 Web Tools And Development CK Wang University of Washington Spring 2014.
Denny Cherry Manager of Information Systems MVP, MCSA, MCDBA, MCTS, MCITP.
Denny Cherry Manager of Information Systems twitter.com/mrdenny MVP, MCSA, MCDBA, MCTS, MCITP.
© FPT SOFTWARE – TRAINING MATERIAL – Internal use 04e-BM/NS/HDCV/FSOFT v2/3 Working with MSSQL Server Code:G0-C# Version: 1.0 Author: Pham Trung Hai CTD.
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.
Copyright © 2005 Ed Lance Fundamentals of Relational Database Design By Ed Lance.
Module 16: Performing Ongoing Database Maintenance
Database Design and Management CPTG /23/2015Chapter 12 of 38 Functions of a Database Store data Store data School: student records, class schedules,
Denny Cherry twitter.com/mrdenny.
Denny Cherry twitter.com/mrdenny.
Indexes / Session 2/ 1 of 36 Session 2 Module 3: Types of Indexes Module 4: Maintaining Indexes.
Denny Cherry Manager of Information Systems twitter.com/mrdenny MVP, MCSA, MCDBA, MCTS, MCITP.
Database Fundamental & Design by A.Surasit Samaisut Copyrights : All Rights Reserved.
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.
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.
Constraints Lesson 8. Skills Matrix Constraints Domain Integrity: A domain refers to a column in a table. Domain integrity includes data types, rules,
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.
SQL SERVER DAYS 2011 Indexing Internals Denny Cherry twitter.com/mrdenny.
Retele de senzori Curs 2 - 1st edition UNIVERSITATEA „ TRANSILVANIA ” DIN BRAŞOV FACULTATEA DE INGINERIE ELECTRICĂ ŞI ŞTIINŢA CALCULATOARELOR.
MICROSOFT ACCESS – CHAPTER 5 MICROSOFT ACCESS – CHAPTER 6 MICROSOFT ACCESS – CHAPTER 7 Sravanthi Lakkimsety Mar 14,2016.
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.
Scott Fallen Sales Engineer, SQL Sentry Blog: scottfallen.blogspot.com.
SQL Basics Review Reviewing what we’ve learned so far…….
Database Administration for the Non-DBA Denny Cherry twitter.com/mrdenny.
Data Integrity & Indexes / Session 1/ 1 of 37 Session 1 Module 1: Introduction to Data Integrity Module 2: Introduction to Indexes.
Chris Index Feng Shui Chris
Indexing and hashing.
Indices.
Indexing ? Why ? Need to locate the actual records on disk without having to read the entire table into memory.
Inside of SQL Server Indexes
Module 4: Creating and Tuning Indexes
COMP 430 Intro. to Database Systems
Introduction to SQL Server Management for the Non-DBA
Database Administration for the Non-DBA
What is that service I never turn on?
The Ins and Outs of Indexes
The Ins and Outs of Indexes
Table Indexing for the .NET Developer
Session #, Speaker Name Indexing Chapter 8 11/19/2018.
Lecture 12 Lecture 12: Indexing.
The Ins and Outs of Indexes
Microsoft SQL Server 2014 for Oracle DBAs Module 7
Database systems Lecture 6 – Indexes
Denny Cherry twitter.com/mrdenny
The Ins and Outs of Indexes
All about Indexes Gail Shaw.
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:

Denny Cherry Manager of Information Systems MVP, MCSA, MCDBA, MCTS, MCITP

About Me Author or Coauthor of 4 books 6+ SQL Mag articles Dozens of other articles Microsoft MVP since Oct Microsoft SQL Certifications 1 of 2 MCM Test Completed (go me) Sr. DBA for Phreesia 2

Todays Goals Introduce the different kinds of indexes Common Misconceptions about indexes Downsides to indexes Introduce advanced index tuning techniques Q & A

Todays Goals Introduce the different kinds of indexes Common Misconceptions about indexes Downsides to indexes Introduce advanced index tuning techniques Q & A

Different Kinds of Indexes Four Kinds of Indexes Clustered Non-clustered Full Text XML

Clustered Indexes 1 Clustered Index per table Contain Full Copy of row data within in the index Up to 16 indexed columns can be part of the index (15 if the table contains any XML indexes) Primary Key will by default be the Clustered Index Must be created on the same filegroup as the table Clustered Indexes should be as narrow as possible While not required, they are highly recommended

Non-clustered Index Up to 999 per table Up to 16 indexed columns in the index Non-indexed columns can be included via INCLUDE statement Non-Clustered indexes always contain the clustered index columns (when table has a clustered index) When table is a heap, the Row ID is stored in every non- clustered index. Can be created on any filegroup within the database Can be filtered indexes to include fewer rows in the index.

Differences between unique and non-unique indexes Non-Unique indexes have an extra column called the uniqueifier which ensures that values within the index are unique. Uniqueifier is only used for rows which are not unique. EmpIdUniqufier

Full Text Indexes Not accessed via normal SELECT statements Require use of a predicate: CONTAINS CONTAINSTABLE FREETEXT FREETEXTTABLE Can be used to search binary values (doc, docx, xls, pdf) stored within the database. Natural Language Search

Full Text Indexes (SQL 2005 and below) Created and managed outside of the database via Microsoft Search Service Backed up with the database (starting in SQL 2005) Searches entire index and returns all matches, which you then filter against your normal table to return correct set of rows.

Full Text Indexes (SQL 2008 and up) Now stored within the database Command is still parsed via MS Search service, but looking is done natively Full text search now only searches the required subset of rows

XML Indexes Allows you to index specific nodes of the XML document 249 XML Indexes pre table Requires a Clustered Index on the table Each xml column can have a single primary XML index and multiple secondary XML indexes XML Indexes can only be created on a single XML Column

Todays Goals Introduce the different kinds of indexes Common Misconceptions about indexes Downsides to indexes Introduce advanced index tuning techniques Q & A

Common Misconceptions about indexes Indexes dont require maintenance If I create one index for each column in my where clause Ill be fine The table is sorted based on the order of the Clustered Index Clustered Indexes are required

Todays Goals Introduce the different kinds of indexes Common Misconceptions about indexes Downsides to indexes Introduce advanced index tuning techniques Q & A

Downsides to indexes Indexes take up space On large complex databases the indexes can take up more space than the table Data is duplicated in each index which contains the column Indexes slow down insert, update, delete (especially full text indexes) statements Using the wrong index can be slower than using no index Encrypted data cant be effectively indexed

Todays Goals Introduce the different kinds of indexes Common Misconceptions about indexes Downsides to indexes Introduce advanced index tuning techniques Q & A

Advanced Index Tuning Techniques Fillfactor Tells the SQL Server how much free space to leave in the leaf level pages. Padding Tells the SQL Server to use the Fillfactor setting to leave free space in the intermediate-level pages. Online Rebuilds Data Compression

Using the Advanced Index Tuning Techniques CREATE INDEX MyIndex ON dbo.MyTable ON (Col1, Col5, Col3) INCLUDE (Col4, Col2) WHERE Col6 = Value3 WITH (FILLFACTOR=70, PAD_INDEX=ON, ONLINE=ON, DATA_COMPRESSION = ROW | PAGE);

Physical Index B-Tree Layout Clustered (BOL 2005 / 2008) Non-Clustered (BOL 2005 / 2008)

Q & A

Please rate my presentation at