SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Buffer Pool


Buffer Pool

Author
Message
SQLSACT
SQLSACT
SSCertifiable
SSCertifiable (5.1K reputation)SSCertifiable (5.1K reputation)SSCertifiable (5.1K reputation)SSCertifiable (5.1K reputation)SSCertifiable (5.1K reputation)SSCertifiable (5.1K reputation)SSCertifiable (5.1K reputation)SSCertifiable (5.1K reputation)

Group: General Forum Members
Points: 5104 Visits: 2969
GilaMonster (11/9/2012)
SQLSACT (11/9/2012)
[quote]I'm trying to understand what happens to clean pages in the buffer pool (when a select statement brings pages into the buffer pool).

What happens to the pages once the select statement is done with them?


Nothing.

Neither checkpoint nor lazywriter 'removes' dirty pages from the buffer pool. They just write the changes back to disk so that the pages are considered clean.


Ok

Now I'm really confused

The way I understood it is:
>> Insert, Update or Delete statement is received by SQL Server
>> Required pages are copied from disk into buffer pool
>> Changes are made to affected pages
>> Checkpoint/Lazy Writer process writes the pages back to disk, replacing the original page on disk.

Am I missing something here?

Thanks
CapnHector
CapnHector
Hall of Fame
Hall of Fame (3.3K reputation)Hall of Fame (3.3K reputation)Hall of Fame (3.3K reputation)Hall of Fame (3.3K reputation)Hall of Fame (3.3K reputation)Hall of Fame (3.3K reputation)Hall of Fame (3.3K reputation)Hall of Fame (3.3K reputation)

Group: General Forum Members
Points: 3347 Visits: 1789
SQLSACT (11/9/2012)
GilaMonster (11/9/2012)
SQLSACT (11/9/2012)
[quote]I'm trying to understand what happens to clean pages in the buffer pool (when a select statement brings pages into the buffer pool).

What happens to the pages once the select statement is done with them?


Nothing.

Neither checkpoint nor lazywriter 'removes' dirty pages from the buffer pool. They just write the changes back to disk so that the pages are considered clean.


Ok

Now I'm really confused

The way I understood it is:
>> Insert, Update or Delete statement is received by SQL Server
>> Required pages are copied from disk into buffer pool
>> Changes are made to affected pages
>> Checkpoint/Lazy Writer process writes the pages back to disk, replacing the original page on disk.

Am I missing something here?

Thanks


one last step, the now "clean" pages remain in the buffer pool as clean pages until SQL Server needs the memory for something else.


For faster help in answering any problems Please read How to post data/code on a forum to get the best help - Jeff Moden for the best way to ask your question.

For performance Issues see how we like them posted here: How to Post Performance Problems - Gail Shaw

Need to Split some strings? Jeff Moden's DelimitedSplit8K
Jeff Moden's Cross tab and Pivots Part 1
Jeff Moden's Cross tab and Pivots Part 2
Orlando Colamatteo
Orlando Colamatteo
SSC-Forever
SSC-Forever (40K reputation)SSC-Forever (40K reputation)SSC-Forever (40K reputation)SSC-Forever (40K reputation)SSC-Forever (40K reputation)SSC-Forever (40K reputation)SSC-Forever (40K reputation)SSC-Forever (40K reputation)

Group: General Forum Members
Points: 40694 Visits: 14413
Joie Andrew (11/9/2012)
Take a look at Kalen Delaney's excellent book "Microsoft SQL Server 2008 Internals"

+1 An excellent source of this type of information.

__________________________________________________________________________________________________
There are no special teachers of virtue, because virtue is taught by the whole community. --Plato
SQLSACT
SQLSACT
SSCertifiable
SSCertifiable (5.1K reputation)SSCertifiable (5.1K reputation)SSCertifiable (5.1K reputation)SSCertifiable (5.1K reputation)SSCertifiable (5.1K reputation)SSCertifiable (5.1K reputation)SSCertifiable (5.1K reputation)SSCertifiable (5.1K reputation)

Group: General Forum Members
Points: 5104 Visits: 2969
capnhector (11/9/2012)
SQLSACT (11/9/2012)
GilaMonster (11/9/2012)
SQLSACT (11/9/2012)
[quote]I'm trying to understand what happens to clean pages in the buffer pool (when a select statement brings pages into the buffer pool).

What happens to the pages once the select statement is done with them?


Nothing.

Neither checkpoint nor lazywriter 'removes' dirty pages from the buffer pool. They just write the changes back to disk so that the pages are considered clean.


Ok

Now I'm really confused

The way I understood it is:
>> Insert, Update or Delete statement is received by SQL Server
>> Required pages are copied from disk into buffer pool
>> Changes are made to affected pages
>> Checkpoint/Lazy Writer process writes the pages back to disk, replacing the original page on disk.

Am I missing something here?

Thanks


one last step, the now "clean" pages remain in the buffer pool as clean pages until SQL Server needs the memory for something else.


Are these clean pages or clean buffers?

Thanks
SQLSACT
SQLSACT
SSCertifiable
SSCertifiable (5.1K reputation)SSCertifiable (5.1K reputation)SSCertifiable (5.1K reputation)SSCertifiable (5.1K reputation)SSCertifiable (5.1K reputation)SSCertifiable (5.1K reputation)SSCertifiable (5.1K reputation)SSCertifiable (5.1K reputation)

Group: General Forum Members
Points: 5104 Visits: 2969
GilaMonster (11/9/2012)
SQLSACT (11/9/2012)
[quote]I'm trying to understand what happens to clean pages in the buffer pool (when a select statement brings pages into the buffer pool).

What happens to the pages once the select statement is done with them?


Nothing.

Neither checkpoint nor lazywriter 'removes' dirty pages from the buffer pool. They just write the changes back to disk so that the pages are considered clean.


Thanks Gail

Please help me understand this process

When a checkpoint runs, it doesn't actually remove the page from memory, it marks the page as clean? Does this mean that it removes the contents of the page?

Thanks
CapnHector
CapnHector
Hall of Fame
Hall of Fame (3.3K reputation)Hall of Fame (3.3K reputation)Hall of Fame (3.3K reputation)Hall of Fame (3.3K reputation)Hall of Fame (3.3K reputation)Hall of Fame (3.3K reputation)Hall of Fame (3.3K reputation)Hall of Fame (3.3K reputation)

Group: General Forum Members
Points: 3347 Visits: 1789
SQLSACT (11/10/2012)


Are these clean pages or clean buffers?

Thanks


these are clean pages. SQL Server only drops pages from the buffer if there is not enough memory (or the server is restarted or you manually drop the cache). otherwise SQL Server holds the pages in memory for the next time they are accessed. that way the next query that is run the server wont have to read those pages from disk again. if the database is smaller than the ram on the system eventually the entire database may sit in memory and there is very little reading from disk. if the database is larger than the amount of ram on the system SQL Server has a very well designed algorithm for figuring out which pages have not been accessed in a while.


For faster help in answering any problems Please read How to post data/code on a forum to get the best help - Jeff Moden for the best way to ask your question.

For performance Issues see how we like them posted here: How to Post Performance Problems - Gail Shaw

Need to Split some strings? Jeff Moden's DelimitedSplit8K
Jeff Moden's Cross tab and Pivots Part 1
Jeff Moden's Cross tab and Pivots Part 2
GilaMonster
GilaMonster
SSC Guru
SSC Guru (229K reputation)SSC Guru (229K reputation)SSC Guru (229K reputation)SSC Guru (229K reputation)SSC Guru (229K reputation)SSC Guru (229K reputation)SSC Guru (229K reputation)SSC Guru (229K reputation)

Group: General Forum Members
Points: 229446 Visits: 46344
SQLSACT (11/10/2012)
Does this mean that it removes the contents of the page?


No. I already told you more than once what happens when checkpoint writes a page. I'm pretty sure I've also told you the definition of 'clean page' more than once, to start with...
They just write the changes back to disk so that the pages are considered clean.


That doesn't say 'clear', 'empty', or 'discard' anywhere.

Please go and read some of the material that I and others have referred you to, Kalen's book especially

Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

We walk in the dark places no others will enter
We stand on the bridge and no one may pass


Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search