pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Martijn van Oosterhout <kleptog@svana.org>
To: Gavin Sherry <swm@linuxworld.com.au>
Cc: Qingqing Zhou <zhouqq@cs.toronto.edu>
Cc: pgsql-hackers@postgresql.org
Subject: Re: ice-broker scan thread
Date: Tue, 29 Nov 2005 12:02:22 +0100
Message-ID: <20051129110214.GA31333@svana.org> (raw)
In-Reply-To: <Pine.LNX.4.58.0511291429330.18112@linuxworld.com.au>
References: <Pine.LNX.4.58.0511282217470.13586@josh.db>
	<Pine.LNX.4.58.0511291429330.18112@linuxworld.com.au>

On Tue, Nov 29, 2005 at 02:53:36PM +1100, Gavin Sherry wrote:
> The second idea is using posix async IO at key points within the system
> to better parallelise CPU and IO work. There areas I think we could use
> async IO are: during sequential scans, use async IO to do pre-fetching of
> blocks; inside WAL, begin flushing WAL buffers to disk before we commit;
> and, inside the background writer/check point process, asynchronously
> write out pages and, potentially, asynchronously build new checkpoint segments.

I actually worked on this and got it to the stage where it wouldn't
crash anymore. It basically added a command to bufmgr.c called
PrefetchBuffer() which would initiate a request but not block. I then
hooked a few strategic places to call this. In particular during an
index scan, it would prefetch the next index block and the next few
data blocks and then return them in order as they came in.

Unfortunatly I can't really test it at it's full potential because it
uses glibc's default POSIX AIO which is *lame*. No more than one
outstanding request per fd which for PostgreSQL is crappy. There was
some evidence that in an index scan of a highly uncorrelated index that
it did make a small difference, but I never got around to testing it
fully. But bitmap scans already hugely reduce the cost of uncorrelated
indexes.

It doesn't pass regression because index_getmulti doesn't do backward
scans. Everything else works though.

If anyone is interested in the code I can send it to them. The results
on my system just wern't good enough to justify a lot more effort.

Have a nice day,
-- 
Martijn van Oosterhout   <kleptog@svana.org>   http://svana.org/kleptog/
> Patent. n. Genius is 5% inspiration and 95% perspiration. A patent is a
> tool for doing 5% of the work and then sitting around waiting for someone
> else to do the other 95% so you can sue them.

view thread (39+ messages)  latest in thread

Message-ID: <20051129110214.GA31333@svana.org>
Permalink:  ../20051129110214.GA31333@svana.org/
Also on:    postgresql.org/message-id/20051129110214.GA31333@svana.org

 · 

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-hackers@postgresql.org
  Cc: kleptog@svana.org, swm@linuxworld.com.au, zhouqq@cs.toronto.edu
  Subject: Re: ice-broker scan thread
  In-Reply-To: <20051129110214.GA31333@svana.org>

* 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