Increased Performance Using FILE_FLAG_SEQUENTIAL_SCAN

Article translations Article translations
Article ID: 98756 - View products that this article applies to.
This article was previously published under Q98756
Expand all | Collapse all

SUMMARY

There is a flag for CreateFile() called FILE_FLAG_SEQUENTIAL_SCAN which will direct the Cache Manager to access the file sequentially.

Anyone reading potentially large files with sequential access can specify this flag for increased performance. This flag is useful if you are reading files that are "mostly" sequential, but you occasionally skip over small ranges of bytes.

MORE INFORMATION

The effect on the Cache Manager of this flag is two-fold:
  • There is a minor savings because the Cache Manager dispenses with keeping a history of reads on the file, and tries to maintain a high-water mark on read ahead, which is always a certain delta from the most recent read.
  • More importantly, the Cache Manager reads further ahead for sequential access files--currently about three times more than files that are currently detected for sequential access.
If the caller makes multiple passes through a file, there are no negative effects of specifying the sequential flag, because the Cache Manager will still disable read ahead for as long as the application is getting hits on the file (such as on the second or subsequent pass).

If you are working on an application where your ability to sequentially read file data is key to performance, you may want to consider adding the sequential flag to your create file call. This is especially true of applications that use this flag to read from a CD-ROM.

Properties

Article ID: 98756 - Last Review: November 21, 2006 - Revision: 2.1
APPLIES TO
  • Microsoft Win32 Application Programming Interface, when used with:
    • Microsoft Windows NT Advanced Server 3.1
    • Microsoft Windows NT 4.0
    • Microsoft Windows NT 3.51 Service Pack 5
    • Microsoft Windows 95
Keywords: 
KB98756

Give Feedback

 

Contact us for more help

Contact us for more help
Connect with Answer Desk for expert help.
Get more support from smallbusiness.support.microsoft.com