Presentation is loading. Please wait.

Presentation is loading. Please wait.

Kevin Kline, SQL Sentry Director of Engineering Services, Microsoft SQL Server MVP since 2003 Twitter, Facebook, KEKline.

Similar presentations


Presentation on theme: "Kevin Kline, SQL Sentry Director of Engineering Services, Microsoft SQL Server MVP since 2003 Twitter, Facebook, KEKline."— Presentation transcript:

1 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.comhttp://KevinEKline.com/http://ForITPros.com

2 Free Plan Explorer download: http://www.sqlsentry.net/plan-explorer/ http://www.sqlsentry.net/plan-explorer/ Free query tuning consultations: http://answers.sqlperformance.com. http://answers.sqlperformance.com Free new ebook (regularly $10) to attendees. Send request to sales@sqlsentry.net.sales@sqlsentry.net SQL Server educational videos, scripts, and slides: http://SQLSentry.TVhttp://SQLSentry.TV Tuning blog: http://www.sqlperformance.com/http://www.sqlperformance.com/ Monthly eNews tips and tricks: http://www.sqlsentry.net/newsletter-archive.asp http://www.sqlsentry.net/newsletter-archive.asp

3 ACID properties of Transactions o Atomic o Consism tent o Isolated o Durable Speed, scalability, and performance; Maximize hardware Competitive features

4 Talk nerdy to me, baby!

5 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 Buffer Pool - - - - - - Data Cache - - - - - - Plan Cache SQL Server Network Interface TDS Language Event SELECT ? Query Tree Query Plan OLE DB ?

6 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 Relational Engine Optimizer Query Executor Cmd Parser Storage Engine Trans-action Manager: Log & Lock Mgr Trans-action Manager: Log & Lock Mgr Buffer Manager Access Methods Protocol Layer SNI Data File(s) T- Log Buffer Pool - - - - - - Data Cache - - - - - - Plan Cache 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 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 Windows Memory, 64-bit Two otherwise identical servers 16gb of RAM Limitations of 32- bit: /3gb switch opens more RAM AWE needed to utilize anything above 4gb on The “give & take” dichotomy Buffer Pool - - - - - - Plan Cache (no restrictions) - - - - - - Special caches: Sort Cache, Hashing Cache, etc…xxx - - - - - - Data Cache (no restrictions) Buffer Pool - - - - - - Plan Cache (no restrictions) - - - - - - Special caches: Sort Cache, Hashing Cache, etc…xxx - - - - - - Data Cache (no restrictions) Windows Memory, 32-bit Buffer Pool - - - - - - Plan Cache (only RAM under the 4GB AWE threshold can only be used for Plan Cache) - - - - - - Special caches: Sort Cache, Hashing Cache, etc…xxx - - - - - - Data Cache (any RAM available to the instance can be used for Data Cache, but RAM over the 4GB AWE threshold can be used only for Data Cache) Buffer Pool - - - - - - Plan Cache (only RAM under the 4GB AWE threshold can only be used for Plan Cache) - - - - - - Special caches: Sort Cache, Hashing Cache, etc…xxx - - - - - - Data Cache (any RAM available to the instance can be used for Data Cache, but RAM over the 4GB AWE threshold can be used only for Data Cache)

9 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

10 getord Memory finduser sp_1sp_4 16 16 7 2 2 3 3 0 2 7 1 5 6 4 0 1 14 15 13 12 What about buffer cache?

11 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 Buffer Pool - - - - - - Data Cache - - - - - - Plan Cache SQL Server Network Interface TDS Language Event INSERT, UPDATE, or DELETE ? Query Tree Query Plan OLE DB Data Write ? Oooh! So dirty! CheckPoint Lazywriter

12 Relational Engine Optimizer Query Executor Cmd Parser Storage Engine Trans-action Manager: Log & Lock Mgr Trans-action Manager: Log & Lock Mgr Buffer Manager Access Methods Protocol Layer SNI Data File(s) T- Log Buffer Pool - - - - - - Data Cache - - - - - - Plan Cache 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

13 Understanding the internals is as important as any other bit of info you might have Remember: 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?


Download ppt "Kevin Kline, SQL Sentry Director of Engineering Services, Microsoft SQL Server MVP since 2003 Twitter, Facebook, KEKline."

Similar presentations


Ads by Google