Re: Use pread and pwrite instead of lseek + write and read

Tom Lane <tgl@sss.pgh.pa.us>

From: Tom Lane <tgl@sss.pgh.pa.us>
To: Oskari Saarenmaa <os@ohmu.fi>
Cc: Robert Haas <robertmhaas@gmail.com>, "pgsql-hackers@postgresql.org" <pgsql-hackers@postgresql.org>
Date: 2016-09-15T18:11:11Z
Lists: pgsql-hackers
Oskari Saarenmaa <os@ohmu.fi> writes:
> 17.08.2016, 22:11, Tom Lane kirjoitti:
>> I'd be more excited about this if the claimed improvement were more than
>> 1.5%, but you know as well as I do that that's barely above the noise
>> floor for most performance measurements.  I'm left wondering why bother,
>> and why take any risk of de-optimizing on some platforms.

> I think it makes sense to try to optimize for the platforms that people 
> actually use for performance critical workloads, especially if it also 
> allows us to simplify the code and remove more lines than we add.  It's 
> nice if the software still works on legacy platforms, but I don't think 
> we should be concerned about a hypothetical performance impact on 
> platforms no one uses in production anymore.

Well, my point remains that I see little value in messing with
long-established code if you can't demonstrate a benefit that's clearly
above the noise level.  We don't really know whether this change might
have adverse impacts somewhere --- either performance-wise or bug-wise ---
and for that amount of benefit I don't want to take the trouble to find
out.

			regards, tom lane


Commits

  1. Use pg_pread() and pg_pwrite() for data files and WAL.