Re: Introducing a new linux readahead framework - Mailing list pgsql-performance

From Jim C. Nasby
Subject Re: Introducing a new linux readahead framework
Date
Msg-id 20060421043147.GV49405@pervasive.com
Whole thread Raw
In response to Introducing a new linux readahead framework  (Wu Fengguang <wfg@mail.ustc.edu.cn>)
Responses Re: Introducing a new linux readahead framework
List pgsql-performance
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

pgsql-performance by date:

Previous
From: Wu Fengguang
Date:
Subject: Introducing a new linux readahead framework
Next
From: "soni de"
Date:
Subject: Re: Takes too long to fetch the data from database