sql server internals & architecture
DESCRIPTION
SQL Server Internals & Architecture. Kevin Kline, SQL Sentry Director of Engineering Services, [email protected] Microsoft SQL Server MVP since 2003 Twitter , Facebook, LinkedIn @ KEKline Website: http://KevinEKline.com/ , http://ForITPros.com. New eBOOK Available!. - PowerPoint PPT PresentationTRANSCRIPT
![Page 1: SQL Server Internals & Architecture](https://reader036.vdocument.in/reader036/viewer/2022081420/56816588550346895dd8439e/html5/thumbnails/1.jpg)
SQL SERVER INTERNALS & ARCHITECTURE
Kevin Kline, SQL SentryDirector of Engineering Services, [email protected] SQL Server MVP since 2003Twitter , Facebook, LinkedIn @ KEKlineWebsite: http://KevinEKline.com/, http://ForITPros.com
![Page 2: SQL Server Internals & Architecture](https://reader036.vdocument.in/reader036/viewer/2022081420/56816588550346895dd8439e/html5/thumbnails/2.jpg)
NEW eBOOKAVAILABLE!
Monthly tips and tricks inour eNews at http://
www.sqlsentry.net/newsletter-archive.asp
![Page 3: SQL Server Internals & Architecture](https://reader036.vdocument.in/reader036/viewer/2022081420/56816588550346895dd8439e/html5/thumbnails/3.jpg)
Win one of 3 Rookie Experience packages and 3 Ride Along packages from the Richard Petty Driving Experience at Charlotte Motor Speedway after PASS Summit 2013!
October 18, 2013. Details at http://sqlsentry.net/webinarlistings.aspx
![Page 4: SQL Server Internals & Architecture](https://reader036.vdocument.in/reader036/viewer/2022081420/56816588550346895dd8439e/html5/thumbnails/4.jpg)
AGENDA• Droppin’ Acid with RDBMSes• Our Host and Tour Guide• The Life of a Read Statement• Dancing for Cache• The Life of a Write Statement• Summary• Q & A
![Page 5: SQL Server Internals & Architecture](https://reader036.vdocument.in/reader036/viewer/2022081420/56816588550346895dd8439e/html5/thumbnails/5.jpg)
TOOLS FROM SQL SENTRY
![Page 6: SQL Server Internals & Architecture](https://reader036.vdocument.in/reader036/viewer/2022081420/56816588550346895dd8439e/html5/thumbnails/6.jpg)
DROPPING ACID - WHY DOES SQL SERVER DO WHAT IT DOES?
• ACID properties of Transactionso Atomico Consistento Isolatedo Durable
• Speed, scalability, and • performance• Maximize hardware• Competitive features
![Page 7: SQL Server Internals & Architecture](https://reader036.vdocument.in/reader036/viewer/2022081420/56816588550346895dd8439e/html5/thumbnails/7.jpg)
OUR TOUR GUIDETalk nerdy to me, baby!
![Page 8: SQL Server Internals & Architecture](https://reader036.vdocument.in/reader036/viewer/2022081420/56816588550346895dd8439e/html5/thumbnails/8.jpg)
OK, WE’RE DONE
Relational EngineOptimizer
Query Executor
Cmd Parser
Storage EngineTrans-action Manager
Buffer Manager
Access Methods
Protocol LayerSNI
Data File
T-Log
Buffer Pool- - - - - - - - - - - -Data Cache
- - - - - - - - - - - - Plan Cache
SQL Server Network Interface
TDS
LanguageEvent
SELECT
?
QueryTree
QueryPlan
OLEDB
?
![Page 9: SQL Server Internals & Architecture](https://reader036.vdocument.in/reader036/viewer/2022081420/56816588550346895dd8439e/html5/thumbnails/9.jpg)
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!
![Page 10: SQL Server Internals & Architecture](https://reader036.vdocument.in/reader036/viewer/2022081420/56816588550346895dd8439e/html5/thumbnails/10.jpg)
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
![Page 11: SQL Server Internals & Architecture](https://reader036.vdocument.in/reader036/viewer/2022081420/56816588550346895dd8439e/html5/thumbnails/11.jpg)
CACHE AGING & LRU-K BEHAVIOR
getordMemory
finduser
sp_1 sp_4
16 16
7
2233 02
7
1
564
01
14151312
What about buffer cache?
![Page 12: SQL Server Internals & Architecture](https://reader036.vdocument.in/reader036/viewer/2022081420/56816588550346895dd8439e/html5/thumbnails/12.jpg)
BUT WAIT! THERE’S MORE!
Relational EngineOptimizer
Query Executor
Cmd Parser
Storage EngineTransaction Manager: Log & Lock Mgr
Buffer Manager
Access Methods
Protocol LayerSNI
Data File
T-Log
Buffer Pool- - - - - - - - - - - -Data Cache
- - - - - - - - - - - - Plan Cache
SQL Server Network Interface
TDS
LanguageEvent
INSERT, UPDATE, orDELETE
?
QueryTree
QueryPlan
OLEDB
DataWrite ?
Oooh! So dirty!
CheckPoint
Lazywriter
![Page 13: SQL Server Internals & Architecture](https://reader036.vdocument.in/reader036/viewer/2022081420/56816588550346895dd8439e/html5/thumbnails/13.jpg)
SUMMARYUnderstanding the internals is as important as any other bit of info you might haveRemember:
ACID!!!key components of the relational engine?key components of the storage
engine?Key areas of cache?Key areas of the transaction
manager?What two processes conduct writes?
More info?