Comparison of Methods for writing SQL Server Memory Data to Disks

Source: Internet
Author: User
As we all know, adds, deletes, and modifies data first in the memory, which can greatly speed up data operations. When the data in the memory is modified, when the data on the disk has not been modified, the so-called dirty pages are generated. How does SQLServer synchronize the memory and disk data? The following three methods are used:

As we all know, adds, deletes, and modifies data first in the memory, which can greatly speed up data operations. When the data in the memory is modified, when the data on the disk has not been modified, the so-called dirty pages are generated. How does SQLServer synchronize the memory and disk data? The following three methods are used:

As we all know, addition, deletion, and modificationDataFirstMemory, Which can greatly accelerateDataOperation speed; whenMemoryInDataModified, andDiskInData

Before modification, the so-called "dirty page" is generated. How is SQLServer synchronized?MemoryAndDiskOfData? The following three typesMethodIs for synchronizationMemoryAndDiskData.

LazyWrite (inertWrite):
Purpose:
1. Manage idleMemory:
A. regularly check the size of the idle buffer list. When this value is too low, it will scan the entireDataCache to release unused pages (by using the LRU algorithm)MemorySpace;
B. If you find a dirty page that has not been used for a period of time, it willWriteDiskAnd thenMemorySpace is marked as idle space;

2. Coordinate Windows and SQLServerMemory:
A. Monitoring ServerMemoryIf Windows physicalMemoryVery few, it will be released from the idle buffer listMemoryFor Windows;
B. When SQLServer is under heavy load, it will also be allocated to SQLServerMemoryMaximum server not reachedMemoryWhen the threshold value is set, the idle buffer list is added to meet the load requirements.


CheckPoint:
Purpose: The checkpoint is a time point when the checkpoint process is created. At this time point, SQLServer can confirm that all the modifications made to the submitted items have beenWriteDisk, It is a tag,
This mark isDataThe starting point of database recovery, which runs once every minute.DataLibrary, make sure thatDataThe database can be restored within one minute.
Within timeWriteLogDataIn less than 10 MB, SQLServer will not automatically initiate a checkpoint.

Trace flag 3502 records the start and end positions of checkpoints in the error log.

And LazyWriteComparison, CheckPoint does not remove dirty pages from the cache. The CheckPoint Process only ensures that dirty pages areWriteDiskAnd mark the page in the cache
Clean pages.

EagerWrite:
Usually occurs in BCP, select into, WRITETEXT, UPDATETEXT, bulk insert, etc. To speed up these operations, EagerWrite will manageDataPage

These operations will not wait until all pages are createdMemoryInDataWriteTo the page, instead of creating an edge with a higher priorityDataWritePage,

To ensure that the buffer pool has enough space to complete these operations.

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.