Indexing strategies and good physical designs for performance tuning Kenneth Ureña /SpanishPASSVC.

Slides:



Advertisements
Similar presentations
This picture has been released into the public domain by its author, ChiemseeMan at the German Wikipedia projectpublic domainChiemseeManGerman Wikipedia.
Advertisements

Module – 3 Data protection – raid
Big Data Working with Terabytes in SQL Server Andrew Novick
SQL Performance 2011/12 Joe Chang, SolidQ
1 Magnetic Disks 1956: IBM (RAMAC) first disk drive 5 Mb – Mb/in $/year 9 Kb/sec 1980: SEAGATE first 5.25’’ disk drive 5 Mb – 1.96 Mb/in2 625.
Denny Cherry Manager of Information Systems MVP, MCSA, MCDBA, MCTS, MCITP.
Database Optimization & Maintenance Tim Richard ECM Training Conference#dbwestECM Agenda SQL Configuration OnBase DB Planning Backups Integrity.
MID309. This picture has been released into the public domain by its author, ChiemseeMan at the German Wikipedia projectpublic domainChiemseeManGerman.
Microsoft SQL Server Administration for SAP SQL Server Architecture.
Servers Redundant Array of Inexpensive Disks (RAID) –A group of hard disks is called a disk array FIGURE Server with redundant NICs.
Fast Track, Microsoft SQL Server 2008 Parallel Data Warehouse and Traditional Data Warehouse Design BI Best Practices and Tuning for Scaling SQL Server.
Copyright © 2013, Oracle and/or its affiliates. All rights reserved. 1 Preview of Oracle Database 12 c In-Memory Option Thomas Kyte
SQL Server 2008 & Solid State Drives Jon Reade SQL Server Consultant SQL Server 2008 MCITP, MCTS Co-founder SQLServerClub.com, SSC
Sponsored by: PASS Summit 2010 Preview Storage for the DBA Denny Cherry MVP, MCSA, MCDBA, MCTS, MCITP.
DISKS IS421. DISK  A disk consists of Read/write head, and arm  A platter is divided into Tracks and sector  The R/W heads can R/W at the same time.
CS 346 – Chapter 10 Mass storage –Advantages? –Disk features –Disk scheduling –Disk formatting –Managing swap space –RAID.
Redundant Array of Independent Disks
RAID: High-Performance, Reliable Secondary Storage Mei Qing & Chaoxia Liao Nov. 20, 2003.
Exam QUESTION CertKiller.com has hired you as a database administrator for their network. Your duties include administering the SQL Server 2008.
Chapter 2: Designing Physical Storage MCITP Administrator: Microsoft SQL Server 2005 Database Server Infrastructure Design Study Guide (70-443)
I/O – Chapter 8 Introduction Disk Storage and Dependability – 8.2 Buses and other connectors – 8.4 I/O performance measures – 8.6.
Parity Logging O vercoming the Small Write Problem in Redundant Disk Arrays Daniel Stodolsky Garth Gibson Mark Holland.
Module 3: Managing Database Files. Overview Introduction to Data Structures Creating Databases Managing Databases Placing Database Files and Logs Optimizing.
Agenda for Today Chapter 5 –Skip Lesson 2 Review questions Midterm Chapter 6 Review questions.
Ashwani Roy Understanding Graphical Execution Plans Level 200.
Roy Ernest Manager of DBA Dept Pinnacle Sports Worldwide
Large Data Operations Joe Chang
IN-MEMORY OLTP By Manohar Punna SQL Server Geeks – Regional Mentor, Hyderabad Blogger, Speaker.
SQLintersection Putting the "Squeeze" on Large Tables Improve Performance and Save Space with Data Compression Justin Randall Tuesday,
Lock Tuning. Overview Data definition language (DDL) statements are considered harmful DDL is the language used to access and manipulate catalog or metadata.
Jérôme Jaussaud, Senior Product Manager
October 15-18, 2013 Charlotte, NC Accelerating Database Performance Using Compression Joseph D’Antoni, Solutions Architect Anexinet.
Copyright Sammamish Software Services All rights reserved. 1 Prog 140  SQL Server Performance Monitoring and Tuning.
How to kill SQL Server Performance Håkan Winther.
Execution Plans Detail From Zero to Hero İsmail Adar.
Oracle Database Architectural Components
CS422 Principles of Database Systems Disk Access Chengyu Sun California State University, Los Angeles.
I/O Errors 1 Computer Organization II © McQuain RAID Redundant Array of Inexpensive (Independent) Disks – Use multiple smaller disks (c.f.
Introducing Hekaton The next step in SQL Server OLTP performance Mladen Prajdić
Table General Guidelines for Better System Performance
Managing Multi-User Databases
Flash Storage 101 Revolutionizing Databases
SharePoint Solutions Architect, Protiviti
Database Management Systems (CS 564)
SQL Server Internals Overview
UFC #1433 In-Memory tables 2014 vs 2016
Finding more space for your tight environment
A Technical Overview of Microsoft® SQL Server™ 2005 High Availability Beta 2 Matthew Stephen IT Pro Evangelist (SQL Server)
The (Solid) State Of Drive Technology
Windows Azure Migrating SQL Server Workloads
Installation and database instance essentials
Denny Cherry twitter.com/mrdenny
Database Performance Tuning and Query Optimization
Hustle and Bustle of SQL Pages
Lecture 11: DMBS Internals
COMPTIA SK0-004 CompTIA Server+. VceTests provide unique study material for the preparation of SK0-004 with 100% passing guarantee. Get latest SK0-004.
Oracle Storage Performance Studies
Real world In-Memory OLTP
SQL 2014 In-Memory OLTP What, Why, and How
Re-Indexing - The quest of ultimate automation
TEMPDB – INTERNALS AND USAGE
15.6 Index Based Algorithms
Table General Guidelines for Better System Performance
ظرفیت سنجی دستگاه های ذخیره ساز در مراکز داده
In Memory OLTP Not Just for OLTP.
Transaction Log Internals and Performance David M Maxwell
Chapter 11 Database Performance Tuning and Query Optimization
Transaction Log Performance Tuning
Database administration
Hybrid Buffer Pool The Good, the Bad and the Ugly
Presentation transcript:

Indexing strategies and good physical designs for performance tuning Kenneth Ureña /SpanishPASSVC

Agenda  The journey of a transaction  Performance degradation factors  Physical Designs  Indexing  Coding best practices

THE JOURNEY OF A TRANSACTION

Actual empty Virtual Log File Truncated -Sequential Access -Just 1 file Active -Recommended Raid 1 ó Commit, backup log trigger I/O Log File -Random Access -Multiple datafiles Active -Recommended Raid 1/ / 5 -Checkpoint, backup, load / unload Cache FullEmpty FullEmpty Full EmptyFull Data Files Cache fail Loads page Update page Commit Lazy Writter / Checkpoint

PERFORMANCE DEGRADATION FACTORS

HardwareSoftware DB Performance Degradation life cycle Overload Degraded Performance CPU / Memory Storage Peripheral Database Data Algorithm

Sata, SAS, SSD (Types of Hard Drives) Big performance difference between Sequential IO vs Random IO IOPS (In Out Per Second) IOPS Estimated = 1 / ((seek time / 1000) + (latency / 1000)) Storage Reference

Average read seek time: 3.4 ms Average write seek time: 3.9 ms Average latency: 2.0 ms Seek time = ( Average read seek time + Average write seek time) / 2 = ( ) / 2 = 3.65 ms IOPS Estimated = 1 / ((seek time / 1000) + (latency / 1000)) = 1 / ((3.65/1000) + (2.0 / 1000) = ~ 175 IOPS SAS - 600GB 15K - Seagate Reference

Raids Raid 0 Raid 1 Raid 5 Raid 1 + 0

Raid 0 (Stripping)  Logical Drive Characteristics  IOPS = #Disk * IOPS Estimated  S ize = #Disks * Size disk  Pros  High performance  Low cost  Cons  Fault tolerance

Raid 1 (Mirroring)  Logical Drive Characteristics  IOPS = (#Disk / 2) * IOPS Estimated  S ize = (#Disk / 2) * Size disk  Pros  Fault tolerance  Cons  Higher cost

Raid 5  Logical Drive Characteristics  IOPS = (#Disk - 1) * IOPS Estimated  S ize = (#Disk - 1) * Size disk  Pros  Fault tolerance  Cost Effective  Cons  Recalculation on raid failure  Parity calculation

Raid  Logical Drive Characteristics  IOPS = (#Disk /2) * IOPS Estimated  S ize = (#Disk / 2) * Size disk  Pros  Fault tolerance  Cons  Cost

Database Files Random Access Multiple Actives Data File Sequential Access One Active Log File

PHYSICAL DESIGNS

Physical Designs Choosing the right Raid for the Database File Split the files in order to get the expected Access behavior

Scenario #1 1 User Database High OLTP Traffic High TempDB consumption 16 Cores Server

Scenario #1 (Proposal 1) Raid 1+0 Drive SAS TempDB UserDB Raid 5 Drive SAS Raid 1+0 Drive SAS LOG File Data File

Scenario #1 (Proposal 2) Raid 1+0 Drive SAS TempDB UserDB Raid 1+0 Drive SAS Raid 1+0 Drive SAS LOG File Data File

Scenario #1 (Proposal 3) TempDB UserDB Raid 1+0 Drive SSD Raid 1+0 Drive SAS LOG, Data File LOG File Data File

Scenario #2 multiple User Database High OLTP Traffic High TempDB consumption multiple Cores Server

Scenario #2 (Proposal 1) Raid 1+0 Drive SAS TempDB Raid 1+0 Drive SAS Raid 1+0 Drive SAS LOG File Data File UserDBN Raid 1+0 Drive SAS Data File Raid 1 Drive SSD UserDB1 LOG File

INDEXING

Indexes and Organization Table structure Image from SQL server 2008 books online

Indexes and Organization Heap Table Image from: SQL server 2008 books online

Indexes and Organization Clustered Table Image from: SQL server 2008 books online

Clustered (example) Image from:

Indexes and Organization NonClustered Index Image from: SQL server 2008 books online

Column Index Image from

Data access patters  Seek  Scan  Bookmark Lookup

Data access patters DEMO

CODING BEST PRACTICES

Coding Best Practices  Maximize coverage  Avoid conversions (implicit/explicit)  Avoid row by row access (cursor pattern)  Avoid unnecessary sorting  Choose the right index for the expected data pattern access method

Q&A Thank you Kenneth Ureña /SpanishPASSVC