Common SQL Performance Issues AND HOW TO AVOID OR FIX THEM.

Slides:



Advertisements
Similar presentations
Chapter 9. Performance Management Enterprise wide endeavor Research and ascertain all performance problems – not just DBMS Five factors influence DB performance.
Advertisements

DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall 8-1 David M. Kroenke’s Chapter Eight: Database Redesign Database Processing:
5 Common SQL Server Performance Issues Jason Hall-SQL Sentry, Dir of Client Services Blog-jasonhall.blogs.sqlsentry.net.
Virtual techdays INDIA │ 9-11 February 2011 SQL 2008 Query Tuning Praveen Srivatsa │ Principal SME – StudyDesk91 │ Director, AsthraSoft Consulting │ Microsoft.
Introduction to Oracle9i: SQL1 Views. Introduction to Oracle9i: SQL2 Chapter Objectives Create a view, using CREATE VIEW command or the CREATE OR REPLACE.
Chapter 9 Overview  Reasons to monitor SQL Server  Performance Monitoring and Tuning  Tools for Monitoring SQL Server  Common Monitoring and Tuning.
® IBM Software Group © 2006 IBM Corporation The Eclipse Data Perspective and Database Explorer This section describes how to use the Eclipse Data Perspective,
Virtual techdays INDIA │ august 2010 Building ASP.NET applications using SQL Server Compact Chaitanya Solapurkar │ Partner Technical Consultant,
SQL Server 2008 Basmah AlQadheeb-213 MIS What is a Database ? A database is a collection of Data that is organized so that it can easily be accessed,
The query processor does what the query plan tells it to do A “good” query plan is essential for a well- performing.
ASP.NET Programming with C# and SQL Server First Edition
Database Systems: Design, Implementation, and Management Eighth Edition Chapter 10 Database Performance Tuning and Query Optimization.
End Show 3.4 Database Management System Unit 3. End Show What is a database? It’s an organized collection of data, related to a particular subject or.
Ideas to Improve SharePoint Usage 4. What are these 4 Ideas? 1. 7 Steps to check SharePoint Health 2. Avoid common Deployment Mistakes 3. Analyze SharePoint.
Improving Efficiency of I/O Bound Systems More Memory, Better Caching Newer and Faster Disk Drives Set Object Access (SETOBJACC) Reorganize (RGZPFM) w/
Chapter 2: SQL – The Basics Objectives: 1.The SQL execution environment 2.SELECT statement 3.SQL Developer & SQL*Plus.
ISV Innovation Presented by ISV Innovation Presented by Business Intelligence Fundamentals: Data Cleansing Ola Ekdahl IT Mentors 9/12/08.
Page 1 SQL Server Myths XV ENCONTRO DA COMUNIDADE SQLPORT Rui Ribeiro MCITP 2011/08/16.
Entity Framework Performance SoftUni Team Technical Trainers Software University
5-1 McGraw-Hill/Irwin Copyright © 2007 by The McGraw-Hill Companies, Inc. All rights reserved.
© 2008 Quest Software, Inc. ALL RIGHTS RESERVED. Perfmon and Profiler 101.
1 Chapter Overview Preparing to Upgrade Performing a Version Upgrade from Microsoft SQL Server 7.0 Performing an Online Database Upgrade from SQL Server.
Upgrading to SQL Server 2000 Kashef Mughal. Multiple Versions SQL Server 2000 supports multiple versions of SQL Server on the same machine It does that.
SQLRX – SQL Server Administration – Tips From the Trenches SQL Server Administration – Tips From the Trenches Troubleshooting Reports of Sudden Slowdowns.
1 Reports. 2 Objectives  Use concatenation in a query  Change column headings and formats  Add a title to a report  Group data in a report  Include.
Views Lesson 7.
Database Systems Design, Implementation, and Management Coronel | Morris 11e ©2015 Cengage Learning. All Rights Reserved. May not be scanned, copied or.
Database Systems Design, Implementation, and Management Coronel | Morris 11e ©2015 Cengage Learning. All Rights Reserved. May not be scanned, copied or.
© 2008 IBM Corporation November 17, 2015 Informix Administration Overview John F. Miller III March 2008.
Free Sql Server Tools Every Dev Should Have Dave Gorman MCSD,MCDBA.
Troubleshooting SQL Server Performance: Tips &Tools Amit Khandelwal.
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,
MISSION CRITICAL COMPUTING Siebel Database Considerations.
Instructor: Pavlos Pavlikas1 How Data is Stored Chapter 8.
A Guide to SQL, Eighth Edition Chapter Six Updating Data.
Performance. Performance Performance is a critical issue especially in a multi-user environment. Benchmarking is one way of testing this.
Meta Data Cardinality Explored CSSQLUG User Group - June 2009.
TOP 10 Thinks you shouldn’t do with/in your database
David M. Kroenke and David J. Auer Database Processing Fundamentals, Design, and Implementation Chapter Eight: Database Redesign.
Connect with life Praveen Srivatsa Founder and CEO – AstraSoft.NET Vinod Kumar Technology Evangelist – Databases and BI.
Database Systems, 8 th Edition SQL Performance Tuning Evaluated from client perspective –Most current relational DBMSs perform automatic query optimization.
How to kill SQL Server Performance Håkan Winther.
You Inherited a Database Now What? What you should immediately check and start monitoring for. Tim Radney, Senior DBA for a top 40 US Bank President of.
This document is provided for informational purposes only and Microsoft makes no warranties, either express or implied, in this document. Information.
Fixing Page Life Expectancy Steve Hood Blog: SimpleSQLServer.com.
Hitting the SQL Server “Go Faster” Button Rob Douglas #509 | Brisbane 2016.
Top 10 Entity Framework Features Every Developer Should Know
You Inherited a Database Now What?
Tuning Transact-SQL Queries
Practical Office 2007 Chapter 10
Entity Framework Performance
Query Performance Tuning: Start to Finish
Hitting the SQL Server “Go Faster” Button
SQL Server Monitoring Overview
Designing Database Solutions for SQL Server
The Top 5 SQL Server Mistakes
Hitting the SQL Server “Go Faster” Button
Cardinality Estimator 2014/2016
Query Optimization Techniques
Top Tips for Better TSQL Stored Procedures
20 Questions with Azure SQL Data Warehouse
Statistics: What are they and How do I use them
Troubleshooting Techniques(*)
SQL Server Performance Tuning
It’s TEMPDB Why Should You Care?
You Inherited a Database Now What?
Query Processing.
Query Optimization Techniques
Using wait stats to determine why my server is slow
Presentation transcript:

Common SQL Performance Issues AND HOW TO AVOID OR FIX THEM

Common SQL Performance Issues  End users writing poor queries  Power users writing poor queries  Junior developers writing poor queries  Senior developers writing poor queries  Software architects writing poor queries.

Query related issues  Transact-SQL Performance Issues  SR0004: Avoid using columns that do not have indexes as test expressions in IN predicates Missing indexes are the most common problem.  SR0005: Avoid using patterns that start with “%” in LIKE predicates Avoid these or use full-text indexes for these fields.  SR0006: Move a column reference to one side of a comparison operator to use a column index Do not do calculations on table column values if you can help it to avoid table scans  SR0007: Use ISNULL(column, default value) on nullable columns in expressions Always provide a default in a comparison on a nullable field, unless specifically checking for NULL.  SR0015: Extract deterministic function calls from WHERE predicates Basically calculate your variables before adding them to the WHERE clause. Think in sets and remove extra calculations from each loop of the set. If you only run it once, then build your set it will be a lot faster.

Query related issues  Chapter 14 — Improving SQL Server Performance (outdated but still good to know)  SQL Magazine article on perf tuning common-sql-server-problems common-sql-server-problems

SQLCop  SQLCop is a little test app. I have most of the tests as sql files so you can run them in a CI build, or you can use the free tool from here:

Entity Framework Issues  Troubleshooting Performance Problems in Entity Framework Applications problems-entity-framework-applications problems-entity-framework-applications  Performance Considerations for Entity Framework 4, 5, and  EF6 Performance Issues performance-issues.aspx performance-issues.aspx  Use.AsNoTracking() when you are not going to update the object. performance-issue performance-issue

The Top 5 Most Common SQL Server Performance Problems 1. Memory Pressure 2. Query Timeout Misunderstood "Timeout expired prior to the completion of..." 3. CXPACKET Wait Type 4. Expecting Auto Update Statistics to Keep Statistics Updated 5. TempDb PAGELATCH Contention common-sql-server-performance-problems/ server-performance-problems/

How To…  How to troubleshoot SQL Server performance issues with simple tools (Part 1: How to collect a detailed Perfmon trace) to-troubleshoot-sql-server-performance-issues-with-simple-tools-part- 1-how-to-collect-a-detailed-perfmon-trace.aspx to-troubleshoot-sql-server-performance-issues-with-simple-tools-part- 1-how-to-collect-a-detailed-perfmon-trace.aspx  How to use SQL tests in your builds with TeamCity or similar CI tools unit-testing-with-teamcity-continuous-integration/ unit-testing-with-teamcity-continuous-integration/