Learn more about ghost history in SQLSERVER

Source: Internet
Author: User
Check out the ghost and shadow records in SQLSERVER, also known as phantom records, and the English name of the ghost and shadow records is ghostrecord. There are two possible ghost and shadow records when truncatetable is used: (1) clustered index table (2) articles on using Snapshot isolation level heap table: Why in clustered index table

Check out the ghost and shadow records in SQL Server, also known as phantom records, and the English name of the ghost and shadow records is ghost record. There are two possible cases of ghost and shadow records when truncate table is used: (1)) clustered index table (2) articles on using Snapshot isolation level heap table: Why in clustered index table

Learn more about ghost history in SQLSERVER

Ghost recording is also called phantom record, and ghost recording is also called ghost record.

Whether the truncate table uses ghosting records

There are two possible ghost and shadow records: (1) clustered index table (2) using the Snapshot isolation level heap table

Related Articles:




Why is there a Ghost Shadow record in the clustered index table? You know that the data pages in the table with clustered indexes are connected by a two-way linked list. The Hong Kong server is rented. If it is deleted immediately,

The index query data is affected. For example, a transaction is using the clustered index to search for data. If a page is deleted at this time,

The search results are not accurate, so when you are idle, You can slowly Delete the data. What do I think?

Ghost record cleanup
Q: In the process information window of the SQL Server Enterprise Manager, I found a background process named "Ghost Record Cleanup, this command is triggered by the user system.

A: When a Hong Kong Server is rented when a row, page, or extended disk is deleted from a database, SQL Server marks these objects as "phantom" (indicating that the deletion operation is pending ), later, use the background task to clear these objects. On the Hong Kong server, the process is Ghost Record Cleanup. Ghost Record Cleanup improves the performance of the Delete command because SQL Server does not need to perform physical Cleanup immediately.

The following content is summarized based on the link provided in the article.

(The ghost cleanup task is executed every five seconds in SQL server.) You can use the trace flag 661 to disable running of the ghost cleanup tool.

This will reduce the physical IO, because the page needs to be saved in the buffer pool for cleanup, logs will be generated, resulting in physical IO.

If the trail mark 661 can be enabled for a database with a large delete volume, the ghost cleanup task will not run.

) TRACESTATUS (661) -- check whether the ghost cleanup tool is running the status column

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.