How to kill SQL Server Performance Håkan Winther.

Slides:



Advertisements
Similar presentations
Tuning: overview Rewrite SQL (Leccotech)Leccotech Create Index Redefine Main memory structures (SGA in Oracle) Change the Block Size Materialized Views,
Advertisements

Module 13: Performance Tuning. Overview Performance tuning methodologies Instance level Database level Application level Overview of tools and techniques.
SQL Server performance tuning basics
Big Data Working with Terabytes in SQL Server Andrew Novick
SQL Performance 2011/12 Joe Chang, SolidQ
Help! My table is getting too big! How to divide and conquer SQL Relay 2014.
Dos and don’ts of Columnstore indexes The basis of xVelocity in-memory technology What’s it all about The compression methods (RLE / Dictionary encoding)
10 Things Not To Do With SQL SQLBits 7. Some things you shouldn’t do.
Virtual techdays INDIA │ 9-11 February 2011 SQL 2008 Query Tuning Praveen Srivatsa │ Principal SME – StudyDesk91 │ Director, AsthraSoft Consulting │ Microsoft.
SQL Server Query Optimizer Cost Formulas Joe Chang
Overview SQL Server 2008 Overview Presented by Tarek Ghazali IT Technical Specialist Microsoft SQL Server MVP, MCTS Microsoft Web Development MCP ITIL.
Troubleshooting SQL Server Enterprise Geodatabase Performance Issues
+ Administering Microsoft SQL Server 2012 Databases Implementing a Data Warehouse with Microsoft SQL Server = Querying Microsoft SQL.
Physical Database Design & Performance. Optimizing for Query Performance For DBs with high retrieval traffic as compared to maintenance traffic, optimizing.
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.
+ Administering Microsoft SQL Server 2012 Databases Implementing a Data Warehouse with Microsoft SQL Server = Querying Microsoft SQL.
Ashwani Roy Understanding Graphical Execution Plans Level 200.
Parallel Execution Plans Joe Chang
Large Data Operations Joe Chang
Parallel Execution Plans Joe Chang
8 1 Chapter 8 Advanced SQL Database Systems: Design, Implementation, and Management, Seventh Edition, Rob and Coronel.
Query Optimizer Execution Plan Cost Model Joe Chang
SQLintersection Putting the "Squeeze" on Large Tables Improve Performance and Save Space with Data Compression Justin Randall Tuesday,
Session 1 Module 1: Introduction to Data Integrity
October 15-18, 2013 Charlotte, NC Accelerating Database Performance Using Compression Joseph D’Antoni, Solutions Architect Anexinet.
Dave LinkedIn
SQL Server Statistics DEMO SQL Server Statistics SREENI JULAKANTI,MCTS.MCITP,MCP. SQL SERVER Database Administration.
Scott Fallen Sales Engineer, SQL Sentry Blog: scottfallen.blogspot.com.
SQL Server Statistics DEMO SQL Server Statistics SREENI JULAKANTI,MCTS.MCITP SQL SERVER Database Administration.
Diving into Query Execution Plans ED POLLACK AUTOTASK CORPORATION DATABASE OPTIMIZATION ENGINEER.
Session Name Pelin ATICI SQL Premier Field Engineer.
SQL Server Magic Buttons! What are Trace Flags and why should I care? Steinar Andersen, SQL Service Nordic AB Thanks to Thomas Kejser for peer-reviewing.
Indexing strategies and good physical designs for performance tuning Kenneth Ureña /SpanishPASSVC.
Hitting the SQL Server “Go Faster” Button Rob Douglas #509 | Brisbane 2016.
Introducing Hekaton The next step in SQL Server OLTP performance Mladen Prajdić
SQL IMPLEMENTATION & ADMINISTRATION Indexing & Views.
Use Cases for In-Memory OLTP Warner Chaves SQL MCM / MVP SQLTurbo.com Pythian.com.
SQL Server Statistics and its relationship with Query Optimizer
Chris Index Feng Shui Chris
Execution Planning for Success
Hitting the SQL Server “Go Faster” Button
Query Tuning without Production Data
UFC #1433 In-Memory tables 2014 vs 2016
Query Tuning without Production Data
Introduction to SQL Server Management for the Non-DBA
Hustle and Bustle of SQL Pages
SQL Server May Let You Do It, But it Doesn’t Mean You Should
Introduction to Execution Plans
The Key to the Database Engine
Hitting the SQL Server “Go Faster” Button
Statistics What are the chances
20 Questions with Azure SQL Data Warehouse
TEMPDB – INTERNALS AND USAGE
In Memory OLTP Not Just for OLTP.
The PROCESS of Queries John Deardurff Website: ThatAwesomeTrainer.com
Indexing For Optimal Performance
SQL Server Query Optimizer Cost Formulas
Dave Bland LinkedIn SQL Server Execution Plans: How to use them to find performance bottlenecks Dave Bland LinkedIn
Four Rules For Columnstore Query Performance
Introduction to Execution Plans
Query Tuning Fundamentals
Diving into Query Execution Plans
Are you following SQL Server Development Best Practices?
SQL Server Query Design and Optimization Recommendations
Introduction to Execution Plans
Sourav Mukherjee Are you following SQL Server Development Best Practices? March 30, 2019 Cincinnati.
Reading execution plans successfully
Introduction to Execution Plans
Presentation transcript:

How to kill SQL Server Performance Håkan Winther

About me: Håkan Winther  Experience:  SQL server since 1995  SQL 6.5, 7.0, 2000, 2005, 2008, 2008R2, 2012, 2014, 2016, Azure  System development since 1989  Speaker at:  SQLUG 2011  Microsoft Summercamp 2011,2012 & 2013  TechDays 2011, 2012  Microsoft Technical bootcamp 2014: Tap your goldmine  Lab Center 2W 2014  Microsoft Thank god it’s SQL Friday 2015  Certifications:  MCITP: SQL Server 2008, Database Developer  MCTS: Microsoft SQL Server 2008, Implementation and Maintenance  MCSA: Microsoft SQL Server  MCSE: Data platform  Passion: Performance optimization  Blog:

Execution plan  Hardware and configuration methods  Maintanance methods  Programming methods

HARDWARE AND CONFIGURATION

Death by Hardware  Disks  Slow  Not enough  Everything on same disk  Shared with everyone else on a SAN  Memory  Not enough  Nothing left for OS

Death by Default settings  Auto growth  Fill factor  Parallelism  Cost threashold  Max degree  Only 1 tempdb file

Death by power options  Default = balance power options  CPU not running on full speed all the time

Death by standard edition  <128Gb RAM  Lack of online operations  Rebuild index  Lack of partitioning  Lack of compression  No Memory optimized technologies  In-Memory Tables for OLTP  Compiled procedures  Column Store index

DEMO

MAINTENANCE

Death by changing sa password  Someone may actually use SA account!!

Death by bad indexes  Too many  Inserts will be slow  Too few  Reads will be slow  Unused  Wrong column order  Wrong sort order  Wrong clustered index  Never used for seeks, only singleton lookups  Index hints, could work….  …for a while, but then what?

Death by bad statistics  Big tables  No auto update stats  Incrementing columns  New values ”out of range”  Underestimation of query cost  Bad execution plans  Not enough memory allocated

Demo

Death by datamodel  Datatypes  Too big  Wrong type  Implicit conversion  Big tables  Too many columns  Few records / page = many pages to read  Too many records

Death by correlated subqueries  Inner query depends on outer query  RBAR

Death by SELECT *  Clustered index scan or index seek + key lookup depening on  Number of records calculated from statistics

Death by Entity Framework / nHibernate  The lazy way of killing performance, code first  Too big datatypes?  Too denormalized?  Unreadable and unefficient code

Death by optional statements  OVER CLAUSE  Range vs ROW  UNION (ALL)  Distinct values or not

Death by non searchable argument  Index scans instead of seeks  A lot more IO

Death by scalar functions  No statistics = bad execution plan  ”Hidden cost”

Death by table variables  No statistics = bad execution plan

DEMO

Win a 1day SQL 2016 course  Enter your adress at for a chance to win a 1 day course in SQL Server 2016 arranged by SQL Service and LabCenterhttp://bit.ly/sqldag

THANK YOU