T-SQL: Simple Changes That Go a Long Way DAVE ingeniousSQL.com linkedin.com/in/ingenioussql.

Slides:



Advertisements
Similar presentations
DB glossary (focus on typical SQL RDBMS, not XQuery or SPARQL)
Advertisements

Concepts of Database Management Seventh Edition
The University of Akron Dept of Business Technology Computer Information Systems The Relational Model: Query-By-Example (QBE) 2440: 180 Database Concepts.
Midterm Review Lecture 14b. 14 Lectures So Far 1.Introduction 2.The Relational Model 3.Disks and Files 4.Relational Algebra 5.File Org, Indexes 6.Relational.
Fundamentals, Design, and Implementation, 9/e Chapter 11 Managing Databases with SQL Server 2000.
Module 9: Managing Schema Objects. Overview Naming guidelines for identifiers in schema object definitions Storage and structure of schema objects Implementing.
Version 1.0. MCAD MCSD MCPD Enterprise SQL MCTS MCT Software/Web Development Consultant Cryptography/Digital Signature Consultant SQL Server 2005/2008R2/2012.
1 Overview of Databases. 2 Content Databases Example: Access Structure Query language (SQL)
ADVANCE T-SQL: WINDOW FUNCTIONS Rahman Wehelie 7/16/2013 ITC 226.
 Continue queries ◦ You completed two tutorials with step-by-step instructions for creating queries in MS Access. ◦ Now must apply knowledge and skills.
Module 7 Reading SQL Server® 2008 R2 Execution Plans.
Ashwani Roy Understanding Graphical Execution Plans Level 200.
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.
Data Management Console Synonym Editor
Using Special Operators (LIKE and IN)
 Agenda 2/20/13 o Review quiz, answer questions o Review database design exercises from 2/13 o Create relationships through “Lookup tables” o Discuss.
BY SATHISH SQL Basic. Introduction The language Structured English Query Language (SEQUEL) was developed by IBM Corporation, Inc., to use Codd's model.
Mark Inman U.S. Navy (Naval Sea Logistics Center) Session #213 Analytic SQL for Beginners.
Chapter 9 The Microsoft Access 2007 Window © 2007 Lawrenceville Press Slide 1.
Indexes / Session 2/ 1 of 36 Session 2 Module 3: Types of Indexes Module 4: Maintaining Indexes.
More Windowing Functions KEVIN MCCARTY. What are Windowing Functions Again? Introduced in SQL Server 2005 (SQL 2003 Standard) Used to provide operations.
Database Fundamental & Design by A.Surasit Samaisut Copyrights : All Rights Reserved.
AL-MAAREFA COLLEGE FOR SCIENCE AND TECHNOLOGY INFO 232: DATABASE SYSTEMS CHAPTER 7 (Part II) INTRODUCTION TO STRUCTURED QUERY LANGUAGE (SQL) Instructor.
Indexes and Views Unit 7.
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.
IS201 Agenda: 09/19  Modify contents of the database.  Discuss queries: Turning data stored in a database into information for decision making.  Create.
Session 1 Module 1: Introduction to Data Integrity
05 | SET Operators, Windows Functions, and Grouping Brian Alderman | MCT, CEO / Founder of MicroTechPoint Tobias Ternstrom | Microsoft SQL Server Program.
SQL. Originally developed by IBM Standardized in 80’s by ANSI and ISO Language to access relational database and English-like non-procedural Predominant.
SQL Query Analyzer. Graphical tool that allows you to:  Create queries and other SQL scripts and execute them against SQL Server databases. (Query window)
Background Lots of Demos(That’s it.)
Sofia, Bulgaria | 9-10 October SQL Querying Tips & Techniques Richard Campbell.
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.
 Review quiz. Answer questions.  Discuss queries: ◦ What is a query? Turning data stored in a database into information for decision making. ◦ You: Completed.
A Glance at the Window Functions. Window Functions Introduced in SQL 2005 Enhanced in SQL 2012 So-called because they operate on a defined portion of.
7 1 Database Systems: Design, Implementation, & Management, 7 th Edition, Rob & Coronel 7.6 Advanced Select Queries SQL provides useful functions that.
Scripting Just Enough SSIS to be Dangerous. 6/13/2015 Visit the Sponsor tables to enter their end of day raffles. Turn in your completed Event Evaluation.
6/13/2015 Visit the Sponsor tables to enter their end of day raffles. Turn in your completed Event Evaluation form at the end of the day in the Registration.
APRIL 13 th Introduction About me Duško Mirković 7 years of experience.
Data Integrity & Indexes / Session 1/ 1 of 37 Session 1 Module 1: Introduction to Data Integrity Module 2: Introduction to Indexes.
Eugene Meidinger Intermediate Querying: Going Beyond Select
T-SQL Power! Windows That Open Doors Adam
Data Analysis with SQL Window Functions Adam McDonald IT Architect / Senior SQL Developer Smith Travel
Relational Database Design
© 2016, Mike Murach & Associates, Inc.
SQL Implementation & Administration
T-SQL: Simple Changes That Go a Long Way
T-SQL: Simple Changes That Go a Long Way
Data Analysis with SQL Window Functions
The Key to the Database Engine
Cardinality Estimator 2014/2016
WINDOW FUNCTIONS ARE YOUR FRIENDS Dejan
WINDOW FUNCTIONS ARE YOUR FRIENDS Dejan
Indexing Fundamentals
Chapter 4 Summary Query.
Indexing for Beginners
Access: SQL Participation Project
T-SQL gotchas and power-ups
Data Analysis with SQL Window Functions
SQL Aggregation.
Contents Preface I Introduction Lesson Objectives I-2
Chapter 11 Managing Databases with SQL Server 2000
Build on-the-fly reporting with Dynamic SQL
All about Indexes Gail Shaw.
Advanced Database Topics
Introduction to SQL Server and the Structure Query Language
Intermediate Query Structure and Development
T-SQL: Simple Changes That Go a Long Way
Just Enough SSIS Scripting to be Dangerous.
Login Main Functions Via SAS Information Delivery Portal
Presentation transcript:

T-SQL: Simple Changes That Go a Long Way DAVE ingeniousSQL.com linkedin.com/in/ingenioussql

Agenda Performance Heaps CLUSTERED INDEX NONCLUSTERED INDEX SARGable Functionality OUTPUT Table Valued Parameter Window Functions Common Table Expressions

Understand the Problem Before You Fix Create the Problem

About Dave… MCP 2 of 3 toward MCSA: SQL Server 2012 Database / BI Developer Adjunct IngeniousSQL.com

Indexing CLUSTERED NONCLUSTERED Covering Filtered XML Spatial Full-text Column Store

Indexing Clustered Index Physical sorted order One per table PRIMARY KEY Fast key lookup

Indexing Heap Table without a CLUSTERED INDEX Poor performance Table Scans

Indexing Non-Clustered Index Another sorted copy of the data 16 key columns 999 per table dm_db_missing_index_details dm_db_missing_index_groups dm_db_missing_index_group_stats

Indexing Non-Clustered Index FOREIGN KEYs Covered Filtered SARGable

Output INSERT, UPDATE, DELETE, MERGE SCOPE_IDENTITY IDENT_CURRENT INSERTED.* and DELETED.*

Table Valued Parameter Easily store and transfer rows of data User Defined Table Type UNIQUE and PRIMARY KEY Constraints No indexing No statistics Read only as procedure parameters

T-SQL Window Functions Ranking RANK, ROW_NUMBER, NTILE, DENSE_RANK Aggregate AVG, MIN, SUM, COUNT, STDEV, VAR, MAX Analytic LEAD, FIRST_VALUE, LAG, LAST_VALUE

Common Table Expressions CTE Simplify query syntax Multiple reference Recursive queries VIEW alternative

Summary Heaps CLUSTERED INDEX NONCLUSTERED INDEX Covering Indexes Filtered Indexes SARGable INTO OUTPUT Table Valued Parameter Window Functions Common Table Expressions

Questions DAVE ingeniousSQL.com linkedin.com/in/ingenioussql