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

2016-09-15 Thread Tom Lane
Oskari Saarenmaa 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

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

2016-09-15 Thread Oskari Saarenmaa
17.08.2016, 22:11, Tom Lane kirjoitti: Robert Haas writes: I don't understand why you think this would create non-trivial portability issues. The patch as submitted breaks entirely on platforms without pread/pwrite. Yes, we can add a configure test and some shim

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

2016-08-18 Thread Tom Lane
Robert Haas writes: > Well, I think you're pointing out some things that need to be figured > out, but I hardly think that's a good enough reason to pour cold water > on the whole approach. If somebody feels like doing the legwork to find out if those performance hazards

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

2016-08-18 Thread Robert Haas
On Wed, Aug 17, 2016 at 3:11 PM, Tom Lane wrote: > Robert Haas writes: >> I don't understand why you think this would create non-trivial >> portability issues. > > The patch as submitted breaks entirely on platforms without pread/pwrite. > Yes, we can

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

2016-08-17 Thread Tom Lane
Robert Haas writes: > I don't understand why you think this would create non-trivial > portability issues. The patch as submitted breaks entirely on platforms without pread/pwrite. Yes, we can add a configure test and some shim functions to fix that, but the argument that

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

2016-08-17 Thread Claudio Freire
On Wed, Aug 17, 2016 at 10:40 AM, Tom Lane wrote: > Oskari Saarenmaa writes: >> On my laptop a simple pgbench run (scale 100, 15 minutes) shows a 1.5% >> performance improvement. > > I would have hoped for a lot better result before anyone would propose > that

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

2016-08-17 Thread Robert Haas
On Wed, Aug 17, 2016 at 9:40 AM, Tom Lane wrote: > Oskari Saarenmaa writes: >> On my laptop a simple pgbench run (scale 100, 15 minutes) shows a 1.5% >> performance improvement. > > I would have hoped for a lot better result before anyone would propose > that we

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

2016-08-17 Thread Oskari Saarenmaa
17.08.2016, 16:40, Tom Lane kirjoitti: Oskari Saarenmaa writes: On my laptop a simple pgbench run (scale 100, 15 minutes) shows a 1.5% performance improvement. I would have hoped for a lot better result before anyone would propose that we should deal with all the portability

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

2016-08-17 Thread Tom Lane
Oskari Saarenmaa writes: > On my laptop a simple pgbench run (scale 100, 15 minutes) shows a 1.5% > performance improvement. I would have hoped for a lot better result before anyone would propose that we should deal with all the portability issues this'll create. > A 1.5%

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

2016-08-17 Thread Victor Wagner
On Wed, 17 Aug 2016 12:17:35 +0200 Magnus Hagander wrote: > On Wed, Aug 17, 2016 at 11:34 AM, Victor Wagner > wrote: > > I don't think that all platforms, supported by PostgreSQL support > > this API. Especially, I cannot find any mention of

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

2016-08-17 Thread Magnus Hagander
On Wed, Aug 17, 2016 at 12:41 PM, Dagfinn Ilmari Mannsåker < ilm...@ilmari.org> wrote: > Magnus Hagander writes: > > [pread/pwrite] > > > Yeah, Windows does not have those API calls, but it shouldn't be rocket > > science to write a wrapper for it. The standard windows APIs

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

2016-08-17 Thread Dagfinn Ilmari Mannsåker
Magnus Hagander writes: [pread/pwrite] > Yeah, Windows does not have those API calls, but it shouldn't be rocket > science to write a wrapper for it. The standard windows APIs can do the > same thing -- but they'll need access to the HANDLE for the file and not > the posix

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

2016-08-17 Thread Magnus Hagander
On Wed, Aug 17, 2016 at 11:34 AM, Victor Wagner wrote: > On Wed, 17 Aug 2016 10:58:09 +0300 > Oskari Saarenmaa wrote: > > > > > > > The attached patch replaces FileWrite and FileRead with FileWriteAt > > and FileReadAt and removes most FileSeek calls. FileSeek

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

2016-08-17 Thread Victor Wagner
On Wed, 17 Aug 2016 10:58:09 +0300 Oskari Saarenmaa wrote: > > The attached patch replaces FileWrite and FileRead with FileWriteAt > and FileReadAt and removes most FileSeek calls. FileSeek is still > around so we can find the end of a file, but it's not used for > anything

[HACKERS] Use pread and pwrite instead of lseek + write and read

2016-08-17 Thread Oskari Saarenmaa
Hi, The Uber blog post, among other things, pointed out that PG uses lseek + read instead of pread. I didn't see any discussion around that and my Google searches didn't find any posts about pread / pwrite for the past 10 years. With that plus the "C++ port" thread in mind, I was wondering