Re: What exactly is postgres doing during INSERT/UPDATE ? - Mailing list pgsql-performance

From Greg Stark
Subject Re: What exactly is postgres doing during INSERT/UPDATE ?
Date
Msg-id 407d949e0908300852s381118c0w789fafff0e6d6b6@mail.gmail.com
Whole thread Raw
In response to Re: What exactly is postgres doing during INSERT/UPDATE ?  (Merlin Moncure <mmoncure@gmail.com>)
List pgsql-performance
On Sun, Aug 30, 2009 at 4:40 PM, Merlin Moncure<mmoncure@gmail.com> wrote:

> For random writes, raid 5 has to write a minimum of two drives, the
> data being written and parity.  Raid 10 also has to write two drives
> minimum.  A lot of people think parity is a big deal in terms of raid
> 5 performance penalty, but I don't -- relative to the what's going on
> in the drive, xor calculation costs (one of the fastest operations in
> computing) are basically zero, and off-lined if you have a hardware
> raid controller.

The cost is that in order to calculate the parity block the RAID
controller has to *read* in either the old data block being
overwritten and the old parity block or all the other data blocks
which participate in that parity block. So every random write becomes
not just two writes but two reads + two writes.

If you're always writing large sequential hunks at a time then this is
minimized because the RAID controller can just calculate the new
parity block for the whole new hunk. But if you often just seek to
random places in the file and overwrite 8k at a time then things go
very very poorly.

--
greg
http://mit.edu/~gsstark/resume.pdf

pgsql-performance by date:

Previous
From: Merlin Moncure
Date:
Subject: Re: What exactly is postgres doing during INSERT/UPDATE ?
Next
From: Mark Mielke
Date:
Subject: Re: What exactly is postgres doing during INSERT/UPDATE ?