What is the In-Flight log In SQLServer?

Source: Internet
Author: User
In SQLServer, WAL of logs is used to ensure the durability of relational databases. However, due to the characteristics of hard disks, it is impossible to write a log directly to the disk every time a log is generated, therefore, logs are cached and written to the disk only after a certain amount of data is collected. Logs generated but not written to the disk are In-Flight logs. In SQL

In SQL Server, WAL of logs is used to ensure the durability of relational databases. However, due to the hard disk feature, it is impossible to write a log directly to the disk every time a log is generated, therefore, logs are cached and written to the disk only after a certain amount of data is collected. Logs generated but not written to the disk are In-Flight logs. In SQL

In SQL Server, the virtual host uses the WAL of logs to ensure the persistence of the relational database. However, due to the characteristics of the hard disk, it is impossible to write each log directly to the disk, therefore, logs are cached and written to the disk only after a certain amount of data is collected. Logs generated but not written to the disk are In-Flight logs.

In SQL Server, the log size of In-Flight depends on two factors. According to Paul Randal, the log size of In-Flight In Hong Kong virtual hosts cannot exceed 60 kb, therefore, the maximum log size of In-Flight is 60 K. In addition, if the Log Size of In-Flight is not 60 K, if a Commit or Rollback occurs on the US server, the log is directly written to the disk. Therefore, the minimum log size is 512 bytes, and the maximum log size is 60 K. The log size increases by 512 bytes. Here is an example.

 

First, create a simple table and insert 10 million data into it cyclically. This statement generates a large number of logs, as shown in code list 1:

@ I INTEGERSET @ I = 0 WHILE (@ I <100000) NumberVALUES (@ I) SET @ I = @ I + 1

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: [email protected] 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.