SQL Server Deep Dive Denis Reznik Data Architect at Intapp.

Slides:



Advertisements
Similar presentations
Module 13: Performance Tuning. Overview Performance tuning methodologies Instance level Database level Application level Overview of tools and techniques.
Advertisements

new database engine component fully integrated into SQL Server 2014 optimized for OLTP workloads accessing memory resident data achive improvements.
6 SQL Server Integration Same manageability, administration & development experience Integrated queries & transactions Integrated HA and backup/restore.
6.830 Lecture 9 10/1/2014 Join Algorithms. Database Internals Outline Front End Admission Control Connection Management (sql) Parser (parse tree) Rewriter.
EXECUTION PLANS By Nimesh Shah, Amit Bhawnani. Outline  What is execution plan  How are execution plans created  How to get an execution plan  Graphical.
1 - Oracle Server Architecture Overview
Kevin Kline, SQL Sentry Director of Engineering Services, Microsoft SQL Server MVP since 2003 Twitter, Facebook, KEKline.
Enterprise Search. Search Architecture Configuring Crawl Processes Advanced Crawl Administration Configuring Query Processes Implementing People Search.
Conceptual Architecture of PostgreSQL PopSQL Andrew Heard, Daniel Basilio, Eril Berkok, Julia Canella, Mark Fischer, Misiu Godfrey.
Troubleshooting SQL Server Enterprise Geodatabase Performance Issues
Kevin Kline, SQL Sentry Director of Engineering Services, Microsoft SQL Server MVP since 2003 Twitter, Facebook, KEKline.
Chapter Oracle Server An Oracle Server consists of an Oracle database (stored data, control and log files.) The Server will support SQL to define.
Data File Access API : Under the Hood Simon Horwith CTO Etrilogy Ltd.
DBMS Transactions and Rollback Recovery Helia / Martti Laiho.
Module 7 Reading SQL Server® 2008 R2 Execution Plans.
1 Moshe Shadmon ScaleDB Scaling MySQL in the Cloud.
Ashwani Roy Understanding Graphical Execution Plans Level 200.
1 Oracle Architectural Components. 1-2 Objectives Listing the structures involved in connecting a user to an Oracle server Listing the stages in processing.
Oracle Tuning Ashok Kapur Hawkeye Technology, Inc.
Dive into the Query Optimizer Dive into the Query Optimizer: Undocumented Insight Benjamin Nevarez Blog: benjaminnevarez.com
Ingres Version 6.4 An Overview of the Architecture Presented by Quest Software.
Lecture 5 Cost Estimation and Data Access Methods.
QUERY PROCESSING RELATIONAL DATABASE KUSUMA AYU LAKSITOWENING
DB Tuning : Chapter 10. Optimizer Center for E-Business Technology Seoul National University Seoul, Korea 이상근 Intelligent Database Systems Lab School of.
Chapter 13: Query Processing
Dave LinkedIn
Inside Query Processor Sort Dmitry Pilugin SQL Server Developer, MVP (RU) (EN)
Deadlocks 3.0. Final Edition. Everything that developer needs to know Denis Reznik Microsoft SQL Server MVP Director of R&D at Intapp Kyiv.
October 15-18, 2013 Charlotte, NC SQL Server Index Internals Tim Chapman Premier Field Engineer.
Scott Fallen Sales Engineer, SQL Sentry Blog: scottfallen.blogspot.com.
Execution Plans Detail From Zero to Hero İsmail Adar.
Diving into Query Execution Plans ED POLLACK AUTOTASK CORPORATION DATABASE OPTIMIZATION ENGINEER.
No more waiting. Sponsors About me  Database Technology Specialist  MVP  Blogger  Author 3
Oracle Database Architectural Components
SQL Server Internals & Architecture Naomi Williams, SQL DBA LinkedIn
SQL Server Performance Tuning
Dropping acid - Why Does SQL Server Do what it Does?
Denis Reznik Data Architect, Intapp, Inc. Microsoft Data Platform MVP
Thank You! #sqlsatdnipro Denis
SQL Server Internals Overview
IBM INFORMIX online Training in Hyderabad
SQL Server Internals & Architecture
Hustle and Bustle of SQL Pages
Query Execution Expectation-Reality Denis Reznik
Troubleshooting SQL Server Basics
Everything you ever wanted to ask but were too shy
SQL Server 2014 Hidden Treasures Denis Reznik Microsoft SQL Server MVP
Hidden Gems of SQL Server 2014
Hidden gems of SQL Server 2016
SQL Server Performance Tuning Nowadays
Conceptual Architecture of PostgreSQL
Hidden Gems of SQL Server 2016
මොඩියුල විශ්ලේෂණය SQL Server Waits. Tables රැසක් එකට එකතු කිරීම.
Conceptual Architecture of PostgreSQL
Oracle Memory Internals
Query Processing CSD305 Advanced Databases.
Hidden Gems of SQL Server 2014
Статистика ожиданий или как найти место "где болит"
Deadlocks Everything you ever wanted to ask but were too shy
Hidden Gems of SQL Server 2014
Diving into Query Execution Plans
Hidden Gems of SQL Server 2014
Query Processing.
Denis Reznik SQL Server 2017 Hidden Gems.
Why should I care about SQL, if I have ORM?
Using wait stats to determine why my server is slow
Inside the Database Engine
SQL Server Internals And Architecture.
Inside the Database Engine
Denis Reznik SQL Server 2017 Hidden Gems.
Presentation transcript:

SQL Server Deep Dive Denis Reznik Data Architect at Intapp

About me  Kiev, Ukraine  Data Architect at Intapp Inc.  Microsoft MVP  Leader of Kyiv SQL Server User Group  Co-author of “SQL Server MVP Deep Dives vol. 2”  SoftServe IT-Awards judge 2 |

SQL Server Network Interface

SQL Server Protocols  Shared Memory  TCP/IP  Named Pipes  VIA (Deprecated)

TDS Endpoints TCP/IP Shared Memory Named Pipes VIA DAC TCP/IP Note: TDS – Tabular Data Stream

Query Processing

Parser  Parse Query Text  Check base SQL syntax  Check if plan is already in cache  Returns ParseTree

Algebrizer  Check that objects are exist and available in current execution context  Define types for every node in ParseTree  Returns QueryTree (Logical representation of the query)

Optimizer  Goal – get the optimal execution plan Optimizer Query Tree Pre-Optimization Search for trivial plan Load statistics (optional) Simplification – syntax transformation

Optimizer Phase 0 Exploration – plan alternatives Return Transaction Processing plan Load statistics

Optimizer Phase 1 Next set of query rules Returns Quick Plan Estimate parallel plan (executed twice)

Optimizer Phase 2 Full optimization Returns Full Plan Indexed views

Index (B-Tree) - Seek … … 1.. 1M 1.. 2K 2K+1.. 4K 1M-2K.. 1M ,5K 1,5K+1..2K SELECT * FROM Users WHERE Id = 523

Index (B-Tree) - Scan … … 1.. 1M 1.. 2K 2K+1.. 4K 1M-2K.. 1M ,5K 1,5K+1..2K SELECT * FROM Users

Index (B-Tree) – Range Scan … … 1.. 1M 1.. 2K 2K+1.. 4K 1M-2K.. 1M ,5K 1,5K+1..2K SELECT * FROM Users WHERE Id BETWEEN 700 AND 1700

Statistics SELECT * FROM Users WHERE Id BETWEEN 2100 AND 2500

Executor  Execute query using its Query Plan  Ask Storage Engine for data

Demo SQL Server, are you kidding me?

Storage Engine

Buffer Pool Data Cache Database File Access Methods Buffer Manager Select Data

Modify Data Buffer Pool Data Cache Database File Access Methods Buffer Manager Transaction Log Log Manager Log Buffer

Lock Types - Shared S S S S X X

Lock Types - Exclusive X X X X S S

Lock Types - Update U U U U S S S S X X

Lock Types – Intent locks S S IS

S S S S S S … S S n n = 5000 Table S S if lock can’t be put on table, process will try this every n rows 12 Buffer Pool Memory for locks S S > 24% Lock Escalation

Demo Use NOLOCK carefully

SQL OS

Execution model Session Thread Pool Running Suspended Runnable Task(s) SchedulerLogical CPU

Demo Worker Threads Starvation

@denisreznik Thank You!