Skip site navigation (1) Skip section navigation (2)

Re: Prereading using posix_fadvise (was Re: Commitfest patches)

From: Bruce Momjian <bruce(at)momjian(dot)us>
To: Heikki Linnakangas <heikki(at)enterprisedb(dot)com>
Cc: Zeugswetter Andreas OSB SD <Andreas(dot)Zeugswetter(at)s-itsolutions(dot)at>, Gregory Stark <stark(at)enterprisedb(dot)com>, Simon Riggs <simon(at)2ndquadrant(dot)com>, Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Prereading using posix_fadvise (was Re: Commitfest patches)
Date: 2008-03-28 16:25:56
Message-ID: 200803281625.m2SGPuA16626@momjian.us (view raw or flat)
Thread:
Lists: pgsql-hackers
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(at)momjian(dot)us>        http://momjian.us
  EnterpriseDB                             http://enterprisedb.com

  + If your life is a hard drive, Christ can be your backup. +

In response to

Responses

pgsql-hackers by date

Next:From: Zdenek KotalaDate: 2008-03-28 16:44:51
Subject: Is psql command line interface broken on HEAD?
Previous:From: Heikki LinnakangasDate: 2008-03-28 16:14:58
Subject: Re: advancing snapshot's xmin

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group