From: | "Jim C(dot) Nasby" <jnasby(at)pervasive(dot)com> |
---|---|
To: | Wu Fengguang <wfg(at)mail(dot)ustc(dot)edu(dot)cn>, pgsql-performance(at)postgresql(dot)org |
Subject: | Re: Introducing a new linux readahead framework |
Date: | 2006-04-21 04:31:47 |
Message-ID: | 20060421043147.GV49405@pervasive.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | 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(at)pervasive(dot)com
Pervasive Software http://pervasive.com work: 512-231-6117
vcard: http://jim.nasby.net/pervasive.vcf cell: 512-569-9461
From | Date | Subject | |
---|---|---|---|
Next Message | soni de | 2006-04-21 04:42:24 | Re: Takes too long to fetch the data from database |
Previous Message | Wu Fengguang | 2006-04-21 01:38:26 | Introducing a new linux readahead framework |