Heikki Linnakangas wrote:
> > Should we consider only telling the kernel X pages ahead, meaning when
> > we are on page 10 we tell it about page 16?
>
> Yes. You don't want to fire off thousands of posix_fadvise calls
> upfront. That'll just flood the kernel, and it will most likely ignore
> any advise after the first few hundred or so. I'm not sure what the
> appropriate amount of read ahead would be, though. Probably depends a
> lot on the OS and hardware, and needs to be a adjustable.
>
> In some cases we can't easily read ahead more than a certain number of
> pages. For example, in a regular index scan, we can easily fire off
> posix_advise calls for all the heap pages referenced by a single index
> page, but reading ahead more than that becomes much more complex.
And if you read-ahead too far the pages might get pushed out of the
kernel cache before you ask to read them.
-- Bruce Momjian <bruce@momjian.us> http://momjian.us EnterpriseDB
http://enterprisedb.com
+ If your life is a hard drive, Christ can be your backup. +