X-Original-To: pgsql-hackers-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by postgresql.org (Postfix) with ESMTP id 7BFDF9DCBF6 for ; Mon, 28 Nov 2005 23:50:39 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 03267-07 for ; Mon, 28 Nov 2005 23:50:43 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey- Received: from toad.mtbrook.bozemanpass.com (toad.mtbrook.bozemanpass.com [69.145.82.195]) by postgresql.org (Postfix) with ESMTP id D94B99DCB6F for ; Mon, 28 Nov 2005 23:50:36 -0400 (AST) Received: from [69.145.82.253] (unknown [69.145.82.253]) by toad.mtbrook.bozemanpass.com (Postfix) with ESMTP id 2F50D11027B for ; Mon, 28 Nov 2005 19:50:42 -0800 (PST) Message-ID: <438BD013.1000804@boreham.org> Date: Mon, 28 Nov 2005 20:50:43 -0700 From: David Boreham User-Agent: Mozilla Thunderbird 1.0.7 (Windows/20050923) X-Accept-Language: en-us, en MIME-Version: 1.0 To: pgsql-hackers@postgresql.org Subject: Re: ice-broker scan thread References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0 required=5 tests=[AWL=0.000] X-Spam-Score: 0 X-Spam-Level: X-Archive-Number: 200511/1448 X-Sequence-Number: 76730 Qingqing Zhou wrote: >I am considering add an "ice-broker scan thread" to accelerate PostgreSQL >sequential scan IO speed. The basic idea of this thread is just like the >"read-ahead" method, but the difference is this one does not read the data >into shared buffer pool directly, instead, it reads the data into file >system cache, which makes the integration easy and this is unique to >PostgreSQL. > > Interesting, and I wondered about this too. But for my taste the demonstrated benefit really isn't large enough to make it worthwhile. BTW, I heard a long time ago that NTFS has quite fancy read-ahead, where it attempts to detect the application's access pattern including if it is reading sequentially and even if there is a 'stride' to the accesses when they're not contiguous. I would imagine that other filesystems attempt similar tricks. So one might expect a simple linear prefectch to not help much in the presence of such a filesystem. Were you worried about the icebreaker thread getting too far ahead of the scan ? If it did it might page out the data you're about to read, I think. Of course this could be fixed by having the read ahead thread perodically check the current location being read by the query thread and pausing if it's got too far ahead. Anyway, the recent performance thread has been intersting to me because in all my career I've never seen a database that scanned scads of data from disk to process a query. Typically the problems I work on arrange to read the entire database into memory. I think I need to get out more... ;)