pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Gregory Stark <stark@enterprisedb.com>
To: Luke Lonergan <llonergan@greenplum.com>
Cc: Mark Mielke <mark@mark.mielke.cc>
Cc: Carlo Stonebanks <stonec.register@sympatico.ca>
Cc: pgsql-performance@postgresql.org
Subject: Re: random_page_costs - are defaults of 4.0 realistic for SCSI RAID 1
Date: Tue, 11 Sep 2007 08:28:59 +0100
Message-ID: <87lkbdlkxw.fsf@oxford.xeocode.com> (raw)
In-Reply-To: <C30B1716.4236C%llonergan@greenplum.com>
References: <C30B1716.4236C%llonergan@greenplum.com>


"Luke Lonergan" <llonergan@greenplum.com> 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



view thread (27+ messages)  latest in thread

Message-ID: <87lkbdlkxw.fsf@oxford.xeocode.com>
Permalink:  ../87lkbdlkxw.fsf@oxford.xeocode.com/
Also on:    postgresql.org/message-id/87lkbdlkxw.fsf@oxford.xeocode.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-performance@postgresql.org
  Cc: stark@enterprisedb.com, llonergan@greenplum.com, mark@mark.mielke.cc, stonec.register@sympatico.ca
  Subject: Re: random_page_costs - are defaults of 4.0 realistic for SCSI RAID 1
  In-Reply-To: <87lkbdlkxw.fsf@oxford.xeocode.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox