Any task that must perform a physical I/O relinquishes the server’s engine (CPU) while it waits for the I/O to complete. If a table scan must read 1000 pages, and none of those pages are in cache, performing 2K I/O with no asynchronous prefetch means the task makes 1000 loops, executing on the engine, and then sleeping to wait for I/O. Using 16K I/O requires only 125 loops
Asynchronous prefetch speed the performance of queries that perform table scans. Asynchronous prefetch can request all of the pages on an allocation unit that belong to a table when the task fetches the first page from the allocation unit. If the 1000-page table resides on just 4 allocation units, the task requires many fewer cycles through the execution and sleep loops.
Type of I/O |
Loops |
Steps in each loop |
---|---|---|
2K I/O No prefetch |
1000 |
|
16K I/O No prefetch |
125 |
|
Prefetch |
4 |
|
Actual performance depends on cache size and other activity in the data cache.
See Chapter 6, “Tuning Asynchronous Prefetch,” in Performance and Tuning Series: Basics.