pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Merlin Moncure <merlin.moncure@rcsonline.com>
Cc: Bruce Momjian <pgman@candle.pha.pa.us>
Cc: Magnus Hagander <mha@sollentuna.net>
Cc: pgsql-performance@postgresql.org
Subject: Re: seq scan cache vs. index cache smackdown
Date: Mon, 21 Feb 2005 11:27:29 -0500
Message-ID: <448.1109003249@sss.pgh.pa.us> (raw)
In-Reply-To: <6EE64EF3AB31D5448D0007DD34EEB3412A762F@Herge.rcsinc.local>
References: <6EE64EF3AB31D5448D0007DD34EEB3412A762F@Herge.rcsinc.local>

"Merlin Moncure" <merlin.moncure@rcsonline.com> writes:
> Is there a reason why readv/writev have not been considered in the past?

Lack of portability, and lack of obvious usefulness that would justify
dealing with the lack of portability.

I don't think there's any value in trying to write ordinary buffers this
way; making the buffer manager able to write multiple buffers at once
sounds like a great deal of complexity and deadlock risk in return for
not much.  It might be an alternative to the existing proposed patch for
writing multiple WAL buffers at once, but frankly I consider that patch
a waste of effort.  In real scenarios you seldom get to write more than
one WAL page without a forced sync occurring because someone committed.
Even if *your* transaction is long, any other backend committing a small
transaction still fsyncs.  On top of that, the bgwriter will be flushing
WAL in order to maintain the write-ahead rule any time it dumps a dirty
buffer.  I have a personal to-do item to make the bgwriter explicitly
responsible for writing completed WAL pages as part of its duties, but
I haven't done anything about it because I think that it will write lots
of such pages without any explicit code, thanks to the bufmgr's LSN
interlock.  Even if it doesn't get it done that way, the simplest answer
is to add a little bit of code to make sure bgwriter generally does the
writes, and then we don't care.

If you want to experiment with writev, feel free, but I'll want to see
demonstrable performance benefits before any such code actually goes in.

			regards, tom lane



view thread (24+ messages)  latest in thread

Message-ID: <448.1109003249@sss.pgh.pa.us>
Permalink:  ../448.1109003249@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/448.1109003249@sss.pgh.pa.us

 · 

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: tgl@sss.pgh.pa.us, merlin.moncure@rcsonline.com, pgman@candle.pha.pa.us, mha@sollentuna.net
  Subject: Re: seq scan cache vs. index cache smackdown
  In-Reply-To: <448.1109003249@sss.pgh.pa.us>

* 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