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