BTM 382 Database Management Chapter 11.5-6 Writing optimized SQL queries Chitu Okoli Associate Professor in Business Technology Management John Molson.

Slides:



Advertisements
Similar presentations
Database Performance Tuning and Query Optimization
Advertisements

Database Performance Tuning and Query Optimization
Copyright © 2004 Pearson Education, Inc.. Chapter 15 Algorithms for Query Processing and Optimization.
BTM 382 Database Management Chapter 2: Data models Chapter : CAP and Hadoop Chitu Okoli Associate Professor in Business Technology Management John.
COMM 226 Hardware Chitu Okoli Associate Professor in Business Technology Management John Molson School of Business, Concordia University, Montréal 1.
Database Systems: Design, Implementation, and Management Chapter 9 Database Design.
BTM 382 Database Management Chapter 6: Normalization of Database Tables Chitu Okoli Associate Professor in Business Technology Management John Molson School.
COMM 226 Database and content management Chitu Okoli Associate Professor in Business Technology Management John Molson School of Business, Concordia University,
COMM 226 Procurement BPMN exercise
Instructor: Craig Duckett CASE, ORDER BY, GROUP BY, HAVING, Subqueries
Virtual techdays INDIA │ 9-11 February 2011 SQL 2008 Query Tuning Praveen Srivatsa │ Principal SME – StudyDesk91 │ Director, AsthraSoft Consulting │ Microsoft.
14 1 Chapter 14 Database Connectivity and Web Development Database Systems: Design, Implementation, and Management, Seventh Edition, Rob and Coronel.
Database Systems: Design, Implementation, and Management Eighth Edition Chapter 11 Database Performance Tuning and Query Optimization.
BTM 382 Database Management Chapter 1: Database systems
COMM 226 Enterprise Resource Planning (ERP) and SAP
COMM 226 ERD case: School of Business
COMM 226 Assignment 1 Part B: Clarifications and tips
Database Systems: Design, Implementation, and Management Eighth Edition Chapter 11 Database Performance Tuning and Query Optimization.
COMM 226 Acquiring Information Systems Through Projects
COMM 226 IS project cases Chitu Okoli Associate Professor in Business Technology Management John Molson School of Business, Concordia University, Montréal.
BTM 382 Database Management Chapter 4: Entity Relationship (ER) Modeling Chitu Okoli Associate Professor in Business Technology Management John Molson.
Getting Started with Oracle Database 11g Release 2 Express Edition Appendix B DAVID M. KROENKE and DAVID J. AUER DATABASE CONCEPTS, 6 th Edition.
BTM 382 Database Management Chapter 14: XML and cloud databases Chapter 9: Database design Chapter 15: Database administration Chitu Okoli Associate Professor.
DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall 7-1 David M. Kroenke’s Chapter Seven: SQL for Database Construction and.
Database Systems: Design, Implementation, and Management Tenth Edition Chapter 11 Database Performance Tuning and Query Optimization.
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 Eighth Edition Chapter 10 Database Performance Tuning and Query Optimization.
_______________________________________________________________________________________________________________ PHP Bible, 2 nd Edition1  Wiley and the.
COMM 226 Productivity Chitu Okoli Associate Professor in Business Technology Management John Molson School of Business, Concordia University, Montréal.
Chapter 7 Advanced SQL Database Systems: Design, Implementation, and Management, Sixth Edition, Rob and Coronel.
Ashwani Roy Understanding Graphical Execution Plans Level 200.
8 1 Chapter 8 Advanced SQL Database Systems: Design, Implementation, and Management, Seventh Edition, Rob and Coronel.
Course Introduction Assist. Prof. Pongpisit Wuttidittachotti, Ph.D. Faculty of Information Technology King Mongkut's University of Technology North Bangkok.
Copyright © 2004 Pearson Education, Inc.. Chapter 15 Algorithms for Query Processing and Optimization.
COMM 226 Structure, Governance and Ethics Chitu Okoli Associate Professor in Business Technology Management John Molson School of Business, Concordia University,
7 1 Chapter 7 Introduction to Structured Query Language (SQL) Database Systems: Design, Implementation, and Management, Seventh Edition, Rob and Coronel.
BTM 382 Database Management Chapter 7 Introduction to Structured Query Language (SQL) Chitu Okoli Associate Professor in Business Technology Management.
COMM 226 Using information systems to improve business processes Chitu Okoli Associate Professor in Business Technology Management John Molson School of.
By Shanna Epstein IS 257 September 16, Cnet.com Provides information, tools, and advice to help customers decide what to buy and how to get the.
8 1 Chapter 8 Advanced SQL Database Systems: Design, Implementation, and Management, Seventh Edition, Rob and Coronel.
Database Systems Design, Implementation, and Management Coronel | Morris 11e ©2015 Cengage Learning. All Rights Reserved. May not be scanned, copied or.
BTM 382 Database Management Chapter 2: Data models Chapter : CAP and Hadoop Chitu Okoli Associate Professor in Business Technology Management John.
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.
Chapter 5 Index and Clustering
CSC 405: Web Application Engineering II Course Preliminaries Course Objectives Course Objectives Students’ Learning Outcomes Students’ Learning Outcomes.
COMM 226 Innovation and Strategy
Last Updated : 27 th April 2004 Center of Excellence Data Warehousing Group Teradata Performance Optimization.
SQL Query Analyzer. Graphical tool that allows you to:  Create queries and other SQL scripts and execute them against SQL Server databases. (Query window)
ERD case: School of Business Chitu Okoli Associate Professor in Business Technology Management John Molson School of Business, Concordia University, Montréal.
Lecture 15: Query Optimization. Very Big Picture Usually, there are many possible query execution plans. The optimizer is trying to chose a good one.
7 1 Database Systems: Design, Implementation, & Management, 7 th Edition, Rob & Coronel 7.6 Advanced Select Queries SQL provides useful functions that.
Database Systems, 8 th Edition SQL Performance Tuning Evaluated from client perspective –Most current relational DBMSs perform automatic query optimization.
Scott Fallen Sales Engineer, SQL Sentry Blog: scottfallen.blogspot.com.
BTM 382 Database Management Chapter 5: Advanced Data Modeling
BTM 382 Database Management Chapter 8 Advanced SQL Chitu Okoli Associate Professor in Business Technology Management John Molson School of Business, Concordia.
DAY 20: ACCESS CHAPTERS 5, 6, 7 Larry Reaves October 28,
Tuning Transact-SQL Queries
Indexes By Adrienne Watt.
BTM 382 Database Management Chapter 13: Business intelligence and data warehousing Chapter 14-4: Data analytics Chitu Okoli Associate Professor in Business.
3.5 Databases Relationships.
CS422 Principles of Database Systems Course Overview
Database Performance Tuning &
Parameter Sniffing in SQL Server Stored Procedures
Database Performance Tuning and Query Optimization
Chitu Okoli Associate Professor in Business Technology Management
BTM 382 Database Management Chapter 1: Database systems
Chapter 8 Advanced SQL Database Systems: Design, Implementation, and Management, Seventh Edition, Rob and Coronel.
Database Connectivity and Web Development
Chapter 11 Database Performance Tuning and Query Optimization
Queries and SQL in Access
Presentation transcript:

BTM 382 Database Management Chapter Writing optimized SQL queries Chitu Okoli Associate Professor in Business Technology Management John Molson School of Business, Concordia University, Montréal 1

SQL Performance Tuning Evaluated from client perspective –How fast does the query feel to the client? Majority of performance problems are related to poorly written SQL code Although the SQL engine does automatic optimization, it can’t work miracles against inefficiently designed code 2

Index Selectivity Indexes speed up queries that involve searching or sorting SQL engine tries to use indexes whenever possible –Help the engine by changing “whenever” to “almost always” possible Be aware of indexes (or create them if useful), and try to use them in your query design Data sparsity –Low sparsity: relatively small number of different values (e.g. female or male) –High sparsity: relatively large number of different values (e.g. dates of birth) –Indexes are most useful for values with high data sparsity 3

Conditional Expressions Expressed within WHERE or HAVING clauses of a SQL statement –Restricts the output of a query to only rows matching conditional criteria –e.g. =, >, LIKE Careful use of conditional expressions has significant effect on speed of query execution –Various tips on careful usage 4

Sources Most of the slides are adapted from Database Systems: Design, Implementation and Management by Carlos Coronel and Steven Morris. 11th edition (2015) published by Cengage Learning. ISBN 13: Database Systems: Design, Implementation and Management Other sources are noted on the slides themselves 5