Received: from localhost (unknown [200.46.204.184]) by postgresql.org (Postfix) with ESMTP id CB0369F99EA for ; Tue, 11 Sep 2007 04:29:06 -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 00804-07 for ; Tue, 11 Sep 2007 04:28:59 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.5 Received: from oxford.xeocode.com (unknown [87.127.95.196]) by postgresql.org (Postfix) with ESMTP id 9C9EF9F996E for ; Tue, 11 Sep 2007 04:29:02 -0300 (ADT) Received: from localhost.enta.net ([127.0.0.1] helo=oxford.xeocode.com) by oxford.xeocode.com with esmtp (Exim 4.67) (envelope-from ) id 1IV0B9-00038t-P5; Tue, 11 Sep 2007 08:28:59 +0100 To: "Luke Lonergan" Cc: "Mark Mielke" , "Carlo Stonebanks" , Subject: Re: random_page_costs - are defaults of 4.0 realistic for SCSI RAID 1 In-Reply-To: (Luke Lonergan's message of "Mon\, 10 Sep 2007 15\:45\:26 -0700") User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.1 (gnu/linux) X-Draft-From: ("nnimap+mail01.enterprisedb.com:INBOX" 37086) References: From: Gregory Stark Organization: EnterpriseDB Date: Tue, 11 Sep 2007 08:28:59 +0100 Message-ID: <87lkbdlkxw.fsf@oxford.xeocode.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200709/172 X-Sequence-Number: 26717 "Luke Lonergan" writes: > Right now the pattern for index scan goes like this: > > - Find qualifying TID in index > - Seek to TID location in relfile > - Acquire tuple from relfile, return >... > If we implement AIO and allow for multiple pending I/Os used to prefetch > groups of qualifying tuples, basically a form of random readahead Ah, I see what you mean now. It makes a lot more sense if you think of it for bitmap index scans. So, for example, the bitmap index scan could stream tids to the executor and the executor would strip out the block numbers and pass them to the i/o layer saying "i need this block now but following that I'll need these blocks so get them moving now". I think this seems pretty impractical for regular (non-bitmap) index probes though. You might be able to do it sometimes but not very effectively and you won't know when it would be useful. I think what this means is that there are actually *three* kinds of i/o: 1) Sequential which means you get the full bandwidth of your drives * the number of spindles; 2) Random which gets you 1 block per seek latency regardless of how many spindles you have; and 3) Random but with prefetch which gets you the random bandwidth above times the number of spindles. The extra spindles speed up sequential i/o too so the ratio between sequential and random with prefetch would still be about 4.0. But the ratio between sequential and random without prefetch would be even higher. -- Gregory Stark EnterpriseDB http://www.enterprisedb.com