pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Jim C. Nasby <jnasby@pervasive.com>
To: Wu Fengguang <wfg@mail.ustc.edu.cn>
To: pgsql-performance@postgresql.org
Subject: Re: Introducing a new linux readahead framework
Date: Thu, 20 Apr 2006 23:31:47 -0500
Message-ID: <20060421043147.GV49405@pervasive.com> (raw)
In-Reply-To: <20060421013826.GA5217@mail.ustc.edu.cn>
References: <20060421013826.GA5217@mail.ustc.edu.cn>

On Fri, Apr 21, 2006 at 09:38:26AM +0800, Wu Fengguang wrote:
> Greetings,
> 
> I'd like to introduce a new readahead framework for the linux kernel:
> http://www.ussg.iu.edu/hypermail/linux/kernel/0603.2/1021.html
> 
> HOW IT WORKS
> 
> In adaptive readahead, the context based method may be of particular
> interest to postgresql users. It works by peeking into the file cache
> and check if there are any history pages present or accessed. In this
> way it can detect almost all forms of sequential / semi-sequential read
> patterns, e.g.
> 	- parallel / interleaved sequential scans on one file
> 	- sequential reads across file open/close
> 	- mixed sequential / random accesses
> 	- sparse / skimming sequential read
> 
> It also have methods to detect some less common cases:
> 	- reading backward
> 	- seeking all over reading N pages

Are there any ways to inform the kernel that you either are or aren't
doing a sequential read? It seems that in some cases it would be better
to bypass a bunch of tricky logic trying to determine that it's doing a
sequential read. A sequential scan in PostgreSQL would be such a case.

The opposite example would be an index scan of a highly uncorrelated
index, which would produce mostly random reads from the table. In that
case, reading ahead probably makes very little sense, though your logic
might have a better idea of the access pattern than PostgreSQL does.
-- 
Jim C. Nasby, Sr. Engineering Consultant      jnasby@pervasive.com
Pervasive Software      http://pervasive.com    work: 512-231-6117
vcard: http://jim.nasby.net/pervasive.vcf       cell: 512-569-9461



view thread (12+ messages)  latest in thread

Message-ID: <20060421043147.GV49405@pervasive.com>
Permalink:  ../20060421043147.GV49405@pervasive.com/
Also on:    postgresql.org/message-id/20060421043147.GV49405@pervasive.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-performance@postgresql.org
  Cc: jnasby@pervasive.com, wfg@mail.ustc.edu.cn
  Subject: Re: Introducing a new linux readahead framework
  In-Reply-To: <20060421043147.GV49405@pervasive.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox