Re: [PERFORM] A Better External Sort? - Mailing list pgsql-hackers

From Martijn van Oosterhout
Subject Re: [PERFORM] A Better External Sort?
Date
Msg-id 20051006201447.GG10127@svana.org
Whole thread Raw
In response to Re: [PERFORM] A Better External Sort?  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
On Thu, Oct 06, 2005 at 03:57:38PM -0400, Tom Lane wrote:
> Martijn van Oosterhout <kleptog@svana.org> writes:
> > Indeed, one of the things on my list is to remove all the lseeks in
> > favour of pread. Halving the number of kernel calls has got to be worth
> > something right? Portability is an issue ofcourse...
>
> Being sure that it's not a pessimization is another issue.  I note that
> glibc will emulate these functions if the kernel doesn't have them;
> which means you could be replacing one kernel call with three.

From the linux pread manpage:

HISTORY      The pread and pwrite system calls were added to Linux in version      2.1.60; the entries in the i386
systemcall table were added in      2.1.69.  The libc support (including emulation on older kernels      without the
systemcalls) was added in glibc 2.1. 

Are we awfully worried about people still using 2.0 kernels? And it
would replace two calls with three in the worst case, we currently
lseek before every read.

I don't know about other OSes.
--
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.

pgsql-hackers by date:

Previous
From: Alvaro Herrera
Date:
Subject: Re: [PERFORM] A Better External Sort?
Next
From: Martijn van Oosterhout
Date:
Subject: Re: [PERFORM] A Better External Sort?