SlideShare a Scribd company logo
1 of 12
SQL SERVER INTERNALS &
ARCHITECTURE
Kevin Kline, SQL Sentry
Director of Engineering Services, kekline@sqlsentry.com
Microsoft SQL Server MVP since 2003
Twitter , Facebook, LinkedIn @ KEKline
Website: http://KevinEKline.com/, http://ForITPros.com
Tuning blog: http://www.sqlperformance.com/
E-mail ebooks@sqlsentry.com for free copies of our e-books:
DROPPING ACID - WHY DOES SQL SERVER
DO WHAT IT DOES?
• ACID properties of Transactions
o Atomic
o Consistent
o Isolated
o Durable
• Speed, scalability, and
performance; Maximize hardware
• Competitive features
OUR TOUR GUIDE
Talk nerdy
to me, baby!
Buffer
Pool
Ext’ns
OK, WE’RE
DONE
Relational Engine
Optimizer
Query
Executor
Cmd Parser
Storage Engine
Trans-
action
Manager
Buffer
Manager
Access
Methods
Protocol
Layer
SNI
Data
File
T-
Log
Buffer Pool
- - - - - - - - -
- Data Cache
- - - - - - - - -
Plan Cache
SQL Server
Network
Interface
TDS
Language
Event
SQL-
OS
SELECT
?
Query
Tree
Query
Plan
OLE
DB
?
SQLOS AND SCHEDULERS
• 1 Cash Register = 1 Scheduler
• Users are assigned
to a thread
Uh oh!
The out
of soda!
No problem. Step
aside… More
syrup for the
sodas!
Goes to the waiting, i.e.
“suspended queue”
Yeah!
I’m next
in line!
Buffer
Pool
Ext’ns
Relational Engine
Optimizer
Query
Executor
Cmd Parser
Storage Engine
Trans-action
Manager:
Log & Lock
Mgr
Buffer
Manager
Access
Methods
Protocol
Layer
SNI
Data
File(s)
T-
Log
Buffer Pool
- - - - - - - - -
Data Cache
- - - - - - - - -
Plan Cache
SQL Server
Network
Interface
TDS
Language
Event
SQL
OS
?
Query
Tree
Query
Plan
OLE
DB
Data
Write ?
Check
Point
Lazywriter
Latches
Locks
TROUBLE-
SHOOTING WAIT
STATS?
Async_Network_IO
SOS_Scheduler_Yield
Pagelatch_x, Latch_x,
Resource_Semaphore
LCK_x, LCK_M_x
Writelog, Logbuffer
PageIOLatch_x,
Async_IO_Completion,
IO_Completion
CACHES?
• How long does a page of data or
a block of code stay in cache?
• Uses a LRU algorithm
• Usually performed by the lazy-
writer, but can also be done by
any worker thread after
scheduling its own I/O
CACHE AGING & LRU-K BEHAVIOR
getord
Memory
finduser
sp_1 sp_4
16 16
7
2233 02
7
1
564
01
14151312
What about
buffer cache?
Buffer
Pool
Ext’ns
BUT WAIT!
THERE’S MORE!
Relational Engine
Optimizer
Query
Executor
Cmd Parser
Storage Engine
Transaction
Manager:
Log & Lock
Mgr
Buffer
Manager
Access
Methods
Protocol
Layer
SNI
Data
File
T-
Log
Buffer Pool
- - - - - - - - -
Data Cache
- - - - - - - - -
Plan Cache
SQL Server
Network
Interface
TDS
Language
Event
SQL-
OS
INSERT,
UPDATE,
or
DELETE
?
Query
Tree
Query
Plan
OLE
DB
Data
Write ? Oooh! So dirty!
CheckPoint
Lazywriter
DD
Buffer
Pool
Ext’ns
Relational Engine
Optimizer
Query
Executor
Cmd Parser
Storage Engine
Trans-action
Manager:
Log & Lock
Mgr
Buffer
Manager
Access
Methods
Protocol
Layer
SNI
Data
File(s)
T-
Log
Buffer Pool
- - - - - - - - -
Data Cache
- - - - - - - - -
Plan Cache
SQL Server
Network
Interface
TDS
Language
Event
SQL
OS
?
Query
Tree
Query
Plan
OLE
DB
Data
Write ?
Check
Point
Lazywriter
Latches
Locks
HEKATON, A.K.A. IN-
MEMORY OLTP
bit.ly/1uLrXLN - Ovw
bit.ly/1u4nODQ - WP
SUMMARY

More Related Content

What's hot

MySQL Architecture and Engine
MySQL Architecture and EngineMySQL Architecture and Engine
MySQL Architecture and Engine
Abdul Manaf
 
Performance Tuning With Oracle ASH and AWR. Part 1 How And What
Performance Tuning With Oracle ASH and AWR. Part 1 How And WhatPerformance Tuning With Oracle ASH and AWR. Part 1 How And What
Performance Tuning With Oracle ASH and AWR. Part 1 How And What
udaymoogala
 

What's hot (20)

Deep Dive on Amazon RDS
Deep Dive on Amazon RDSDeep Dive on Amazon RDS
Deep Dive on Amazon RDS
 
Log Structured Merge Tree
Log Structured Merge TreeLog Structured Merge Tree
Log Structured Merge Tree
 
MySQL Atchitecture and Concepts
MySQL Atchitecture and ConceptsMySQL Atchitecture and Concepts
MySQL Atchitecture and Concepts
 
Introduction to SQL Server Internals: How to Think Like the Engine
Introduction to SQL Server Internals: How to Think Like the EngineIntroduction to SQL Server Internals: How to Think Like the Engine
Introduction to SQL Server Internals: How to Think Like the Engine
 
MySQL Advanced Administrator 2021 - 네오클로바
MySQL Advanced Administrator 2021 - 네오클로바MySQL Advanced Administrator 2021 - 네오클로바
MySQL Advanced Administrator 2021 - 네오클로바
 
Oracle Database Performance Tuning Advanced Features and Best Practices for DBAs
Oracle Database Performance Tuning Advanced Features and Best Practices for DBAsOracle Database Performance Tuning Advanced Features and Best Practices for DBAs
Oracle Database Performance Tuning Advanced Features and Best Practices for DBAs
 
MySQL Architecture and Engine
MySQL Architecture and EngineMySQL Architecture and Engine
MySQL Architecture and Engine
 
Deep Dive on Amazon Redshift
Deep Dive on Amazon RedshiftDeep Dive on Amazon Redshift
Deep Dive on Amazon Redshift
 
Masterclass - Redshift
Masterclass - RedshiftMasterclass - Redshift
Masterclass - Redshift
 
AlwaysON Basics
AlwaysON BasicsAlwaysON Basics
AlwaysON Basics
 
Oracle Performance Tuning Fundamentals
Oracle Performance Tuning FundamentalsOracle Performance Tuning Fundamentals
Oracle Performance Tuning Fundamentals
 
[오픈소스컨설팅]Day #1 MySQL 엔진소개, 튜닝, 백업 및 복구, 업그레이드방법
[오픈소스컨설팅]Day #1 MySQL 엔진소개, 튜닝, 백업 및 복구, 업그레이드방법[오픈소스컨설팅]Day #1 MySQL 엔진소개, 튜닝, 백업 및 복구, 업그레이드방법
[오픈소스컨설팅]Day #1 MySQL 엔진소개, 튜닝, 백업 및 복구, 업그레이드방법
 
Performance Tuning With Oracle ASH and AWR. Part 1 How And What
Performance Tuning With Oracle ASH and AWR. Part 1 How And WhatPerformance Tuning With Oracle ASH and AWR. Part 1 How And What
Performance Tuning With Oracle ASH and AWR. Part 1 How And What
 
[231]운영체제 수준에서의 데이터베이스 성능 분석과 최적화
[231]운영체제 수준에서의 데이터베이스 성능 분석과 최적화[231]운영체제 수준에서의 데이터베이스 성능 분석과 최적화
[231]운영체제 수준에서의 데이터베이스 성능 분석과 최적화
 
MyRocks introduction and production deployment
MyRocks introduction and production deploymentMyRocks introduction and production deployment
MyRocks introduction and production deployment
 
Oracle Database Performance Tuning Concept
Oracle Database Performance Tuning ConceptOracle Database Performance Tuning Concept
Oracle Database Performance Tuning Concept
 
Introduction to PostgreSQL
Introduction to PostgreSQLIntroduction to PostgreSQL
Introduction to PostgreSQL
 
Physical architecture of sql server
Physical architecture of sql serverPhysical architecture of sql server
Physical architecture of sql server
 
Lessons for the optimizer from running the TPC-DS benchmark
Lessons for the optimizer from running the TPC-DS benchmarkLessons for the optimizer from running the TPC-DS benchmark
Lessons for the optimizer from running the TPC-DS benchmark
 
Microsoft SQL Server Database Administration.pptx
Microsoft SQL Server Database Administration.pptxMicrosoft SQL Server Database Administration.pptx
Microsoft SQL Server Database Administration.pptx
 

Similar to Microsoft SQL Server internals & architecture

UG-SQL-Server-Internals-Architecture.pptx
UG-SQL-Server-Internals-Architecture.pptxUG-SQL-Server-Internals-Architecture.pptx
UG-SQL-Server-Internals-Architecture.pptx
bocaha3988
 
Sql server dba 2012 administration training
Sql server dba 2012 administration trainingSql server dba 2012 administration training
Sql server dba 2012 administration training
FuturePoint Technologies
 
Enter the Dragon - SQL 2014 on Server Core PASS Summit 2014 Edition
Enter the Dragon -  SQL 2014 on Server Core PASS Summit 2014 EditionEnter the Dragon -  SQL 2014 on Server Core PASS Summit 2014 Edition
Enter the Dragon - SQL 2014 on Server Core PASS Summit 2014 Edition
Mark Broadbent
 

Similar to Microsoft SQL Server internals & architecture (20)

UG-SQL-Server-Internals-Architecture.pptx
UG-SQL-Server-Internals-Architecture.pptxUG-SQL-Server-Internals-Architecture.pptx
UG-SQL-Server-Internals-Architecture.pptx
 
KoprowskiT_SQLRelay2014#8_Birmingham_FromPlanToBackupToCloud
KoprowskiT_SQLRelay2014#8_Birmingham_FromPlanToBackupToCloudKoprowskiT_SQLRelay2014#8_Birmingham_FromPlanToBackupToCloud
KoprowskiT_SQLRelay2014#8_Birmingham_FromPlanToBackupToCloud
 
Building and configuring sql server; Some Recommended Practices.
Building and configuring sql server; Some Recommended Practices.Building and configuring sql server; Some Recommended Practices.
Building and configuring sql server; Some Recommended Practices.
 
Rapid SQL Datasheet - The Intelligent IDE for SQL Development
Rapid SQL Datasheet - The Intelligent IDE for SQL DevelopmentRapid SQL Datasheet - The Intelligent IDE for SQL Development
Rapid SQL Datasheet - The Intelligent IDE for SQL Development
 
Enter The Dragon - SQL 2014 on Server Core - SQLSaturday #341 Porto Edition
Enter The Dragon - SQL 2014 on Server Core - SQLSaturday #341 Porto EditionEnter The Dragon - SQL 2014 on Server Core - SQLSaturday #341 Porto Edition
Enter The Dragon - SQL 2014 on Server Core - SQLSaturday #341 Porto Edition
 
Sage 300 ERP: Environment setup and configuration
Sage 300 ERP: Environment setup and configurationSage 300 ERP: Environment setup and configuration
Sage 300 ERP: Environment setup and configuration
 
Configuring SharePoint Server 2013 environment for Business Intelligence Plat...
Configuring SharePoint Server 2013 environment for Business Intelligence Plat...Configuring SharePoint Server 2013 environment for Business Intelligence Plat...
Configuring SharePoint Server 2013 environment for Business Intelligence Plat...
 
SQL Server: Now It's Everywhere You Want to Be
SQL Server: Now It's Everywhere You Want to BeSQL Server: Now It's Everywhere You Want to Be
SQL Server: Now It's Everywhere You Want to Be
 
Sql server dba 2012 administration training
Sql server dba 2012 administration trainingSql server dba 2012 administration training
Sql server dba 2012 administration training
 
Performance Eye for the SQL Guy
Performance Eye for the SQL GuyPerformance Eye for the SQL Guy
Performance Eye for the SQL Guy
 
Migrating on premises workload to azure sql database
Migrating on premises workload to azure sql databaseMigrating on premises workload to azure sql database
Migrating on premises workload to azure sql database
 
SQLSaturday#290_Kiev_WindowsAzureDatabaseForBeginners
SQLSaturday#290_Kiev_WindowsAzureDatabaseForBeginnersSQLSaturday#290_Kiev_WindowsAzureDatabaseForBeginners
SQLSaturday#290_Kiev_WindowsAzureDatabaseForBeginners
 
Best Practice SharePoint Architecture
Best Practice SharePoint ArchitectureBest Practice SharePoint Architecture
Best Practice SharePoint Architecture
 
KoprowskiT_SQLRelay2014#9_London_FromPlanToBackupToCloud
KoprowskiT_SQLRelay2014#9_London_FromPlanToBackupToCloudKoprowskiT_SQLRelay2014#9_London_FromPlanToBackupToCloud
KoprowskiT_SQLRelay2014#9_London_FromPlanToBackupToCloud
 
Sql Azure Pass
Sql Azure PassSql Azure Pass
Sql Azure Pass
 
Sql Azure Pass
Sql Azure PassSql Azure Pass
Sql Azure Pass
 
SEASPC 2011 - SharePoint Security in an Insecure World: Understanding the Fiv...
SEASPC 2011 - SharePoint Security in an Insecure World: Understanding the Fiv...SEASPC 2011 - SharePoint Security in an Insecure World: Understanding the Fiv...
SEASPC 2011 - SharePoint Security in an Insecure World: Understanding the Fiv...
 
Microsoft Technology Services
Microsoft Technology ServicesMicrosoft Technology Services
Microsoft Technology Services
 
Enter the Dragon - SQL 2014 on Server Core PASS Summit 2014 Edition
Enter the Dragon -  SQL 2014 on Server Core PASS Summit 2014 EditionEnter the Dragon -  SQL 2014 on Server Core PASS Summit 2014 Edition
Enter the Dragon - SQL 2014 on Server Core PASS Summit 2014 Edition
 
A Real World Guide to Building Highly Available Fault Tolerant SharePoint Farms
A Real World Guide to Building Highly Available Fault Tolerant SharePoint FarmsA Real World Guide to Building Highly Available Fault Tolerant SharePoint Farms
A Real World Guide to Building Highly Available Fault Tolerant SharePoint Farms
 

More from Kevin Kline

More from Kevin Kline (6)

Who wants to be a DBA? Roles and Responsibilities
Who wants to be a DBA? Roles and ResponsibilitiesWho wants to be a DBA? Roles and Responsibilities
Who wants to be a DBA? Roles and Responsibilities
 
Reduce latency and boost sql server io performance
Reduce latency and boost sql server io performanceReduce latency and boost sql server io performance
Reduce latency and boost sql server io performance
 
Understanding and preventing sql injection attacks
Understanding and preventing sql injection attacksUnderstanding and preventing sql injection attacks
Understanding and preventing sql injection attacks
 
Ten query tuning techniques every SQL Server programmer should know
Ten query tuning techniques every SQL Server programmer should knowTen query tuning techniques every SQL Server programmer should know
Ten query tuning techniques every SQL Server programmer should know
 
Convince me – persuasion techniques that get things done
Convince me – persuasion techniques that get things doneConvince me – persuasion techniques that get things done
Convince me – persuasion techniques that get things done
 
Top 10 DBA Mistakes on Microsoft SQL Server
Top 10 DBA Mistakes on Microsoft SQL ServerTop 10 DBA Mistakes on Microsoft SQL Server
Top 10 DBA Mistakes on Microsoft SQL Server
 

Recently uploaded

Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
vu2urc
 

Recently uploaded (20)

A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdf
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of Brazil
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation Strategies
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 

Microsoft SQL Server internals & architecture

  • 1. SQL SERVER INTERNALS & ARCHITECTURE Kevin Kline, SQL Sentry Director of Engineering Services, kekline@sqlsentry.com Microsoft SQL Server MVP since 2003 Twitter , Facebook, LinkedIn @ KEKline Website: http://KevinEKline.com/, http://ForITPros.com
  • 2. Tuning blog: http://www.sqlperformance.com/ E-mail ebooks@sqlsentry.com for free copies of our e-books:
  • 3. DROPPING ACID - WHY DOES SQL SERVER DO WHAT IT DOES? • ACID properties of Transactions o Atomic o Consistent o Isolated o Durable • Speed, scalability, and performance; Maximize hardware • Competitive features
  • 4. OUR TOUR GUIDE Talk nerdy to me, baby!
  • 5. Buffer Pool Ext’ns OK, WE’RE DONE Relational Engine Optimizer Query Executor Cmd Parser Storage Engine Trans- action Manager Buffer Manager Access Methods Protocol Layer SNI Data File T- Log Buffer Pool - - - - - - - - - - Data Cache - - - - - - - - - Plan Cache SQL Server Network Interface TDS Language Event SQL- OS SELECT ? Query Tree Query Plan OLE DB ?
  • 6. SQLOS AND SCHEDULERS • 1 Cash Register = 1 Scheduler • Users are assigned to a thread Uh oh! The out of soda! No problem. Step aside… More syrup for the sodas! Goes to the waiting, i.e. “suspended queue” Yeah! I’m next in line!
  • 7. Buffer Pool Ext’ns Relational Engine Optimizer Query Executor Cmd Parser Storage Engine Trans-action Manager: Log & Lock Mgr Buffer Manager Access Methods Protocol Layer SNI Data File(s) T- Log Buffer Pool - - - - - - - - - Data Cache - - - - - - - - - Plan Cache SQL Server Network Interface TDS Language Event SQL OS ? Query Tree Query Plan OLE DB Data Write ? Check Point Lazywriter Latches Locks TROUBLE- SHOOTING WAIT STATS? Async_Network_IO SOS_Scheduler_Yield Pagelatch_x, Latch_x, Resource_Semaphore LCK_x, LCK_M_x Writelog, Logbuffer PageIOLatch_x, Async_IO_Completion, IO_Completion
  • 8. CACHES? • How long does a page of data or a block of code stay in cache? • Uses a LRU algorithm • Usually performed by the lazy- writer, but can also be done by any worker thread after scheduling its own I/O
  • 9. CACHE AGING & LRU-K BEHAVIOR getord Memory finduser sp_1 sp_4 16 16 7 2233 02 7 1 564 01 14151312 What about buffer cache?
  • 10. Buffer Pool Ext’ns BUT WAIT! THERE’S MORE! Relational Engine Optimizer Query Executor Cmd Parser Storage Engine Transaction Manager: Log & Lock Mgr Buffer Manager Access Methods Protocol Layer SNI Data File T- Log Buffer Pool - - - - - - - - - Data Cache - - - - - - - - - Plan Cache SQL Server Network Interface TDS Language Event SQL- OS INSERT, UPDATE, or DELETE ? Query Tree Query Plan OLE DB Data Write ? Oooh! So dirty! CheckPoint Lazywriter DD
  • 11. Buffer Pool Ext’ns Relational Engine Optimizer Query Executor Cmd Parser Storage Engine Trans-action Manager: Log & Lock Mgr Buffer Manager Access Methods Protocol Layer SNI Data File(s) T- Log Buffer Pool - - - - - - - - - Data Cache - - - - - - - - - Plan Cache SQL Server Network Interface TDS Language Event SQL OS ? Query Tree Query Plan OLE DB Data Write ? Check Point Lazywriter Latches Locks HEKATON, A.K.A. IN- MEMORY OLTP bit.ly/1uLrXLN - Ovw bit.ly/1u4nODQ - WP