Lazy Writer of SQL Server memory management

Source: Internet
Author: User
Tags server memory

Any pages that are modified in the buffer are marked as dirty pages. Writing this dirty page to the data disk is the work of checkpoint or lazy writer. In front of the general said a bit about checkpoint, this will be a simple understanding of this lazy writer.

The purpose of Lazy Writer's existence is to manage buffers. When a buffer reaches a critical value, Lazy writer stores the dirty pages in the buffer in a disk file, freeing the unmodified pages and reclaiming the resources.
We know that when executing a statement such as: BEGIN TRAN INSERT INTO table_name (1111) Commit--rollback analyze the execution of the statement for a moment 1:be Gin train Write buffer log 2: Buffer log write operation 3: Insert data into buffer modify page 4: Buffer log write COMMIT5: Commit to transaction log when commit commits, SQL Server's pre-write mechanism writes the operation to the transaction log first ( The previous article about this piece or write the wrong, because the transaction log is committed to commit to the log file, so that the buffer is not a transaction log operation, that is, checkpoint and lazy writer occurs, only the dirty pages will be written to the MDF file) Below to move a picture of Song to see, slightly modified, very intuitive:
Here are some of the differences between checkpoints and lazy writing, in fact, these differences are already well known, but we still list the difference between the two for you to learn: Checkpoint and LazyWriter will write the buffer viscera page to disk LazyWriter will update the buffer free available list, and checkpoint will not, checkpoint operation will be recorded in the database log, and LazyWriter will not, LazyWriter is the memory reaches a critical value of the time automatically occurs, Make sure that the cache is used, and the checkpoint does not care how much the cache is used, but automatically occurs.

Lazy Writer of SQL Server memory management

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.