Received: from localhost (unknown [200.46.204.184]) by postgresql.org (Postfix) with ESMTP id A66569F9B87 for ; Tue, 11 Sep 2007 06:01:33 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.184]) (amavisd-maia, port 10024) with ESMTP id 38816-02 for ; Tue, 11 Sep 2007 06:01:21 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.5 Received: from mail01.enterprisedb.com (mail01.enterprisedb.com [63.246.7.168]) by postgresql.org (Postfix) with ESMTP id C4F819F9AFB for ; Tue, 11 Sep 2007 06:01:25 -0300 (ADT) thread-index: Acf0Ul0LFgFuHsX0Sh2ZGaWKxBKd8Q== Received: from [192.168.1.33] ([82.20.14.183]) by mail01.enterprisedb.com over TLS secured channel with Microsoft SMTPSVC(6.0.3790.3959); Tue, 11 Sep 2007 05:01:38 -0400 Content-Class: urn:content-classes:message Importance: normal X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.4073 Message-ID: <46E6593E.1050008@enterprisedb.com> Date: Tue, 11 Sep 2007 10:00:46 +0100 From: "Heikki Linnakangas" User-Agent: Icedove 1.5.0.12 (X11/20070730) MIME-Version: 1.0 To: "Luke Lonergan" Cc: "Mark Mielke" , "Gregory Stark" , "Carlo Stonebanks" , Subject: Re: random_page_costs - are defaults of 4.0 realistic for SCSI RAID 1 References: In-Reply-To: Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 7bit X-OriginalArrivalTime: 11 Sep 2007 09:01:38.0765 (UTC) FILETIME=[5CF8BFD0:01C7F452] X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200709/178 X-Sequence-Number: 26723 Luke Lonergan wrote: > For plans that qualify with the above conditions, the executor will issue > blocking calls to lseek(), which will translate to a single disk actuator > moving to the needed location in seek_time, approximately 8ms. I doubt it's actually the lseeks, but the reads/writes after the lseeks that block. > If we implement AIO and allow for multiple pending I/Os used to prefetch > groups of qualifying tuples, basically a form of random readahead, we can > improve the throughput for any given query by taking advantage of multiple > disk actuators. Rather than jumping to AIO, which is a huge change, I think we could get much of the benefit by using posix_fadvise(WILLNEED) in strategic places to tell the OS what pages we're going to need in the near future. If the OS has implemented that properly, it should schedule I/Os for the requested pages ahead of time. That would require very little change to PostgreSQL code, and could simply be #ifdef'd away on platforms that don't support posix_fadvise. > Note that > the same approach would also work to speed sequential access by overlapping > compute and I/O. Yes, though the OS should already doing read ahead for us. How efficient it is is another question. posix_fadvise(SEQUENTIAL) could be used to give a hint on that as well. -- Heikki Linnakangas EnterpriseDB http://www.enterprisedb.com