The following stack trace could cause reduced performance in cases when the speculative read-ahead is futile, and some useful pages are evicted as a result:
It could be more useful to only attempt read-ahead if a free block is available in the buffer pool without evicting any page that:
- is not marked as freed, or
- is not marked as dirty
Furthermore, we should probably avoid read-ahead altogether for temporary tables.