X-Original-To: pgsql-hackers-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 4529ADA407; Thu, 6 Oct 2005 17:14:58 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 46406-07; Thu, 6 Oct 2005 20:14:55 +0000 (GMT) Received: from svana.org (svana.org [203.20.62.76]) by svr1.postgresql.org (Postfix) with ESMTP id 03C7DDA41E; Thu, 6 Oct 2005 17:14:55 -0300 (ADT) Received: from kleptog by svana.org with local (Exim 3.35 #1 (Debian)) id 1ENc8d-0005YC-00; Fri, 07 Oct 2005 06:14:47 +1000 Date: Thu, 6 Oct 2005 22:14:47 +0200 From: Martijn van Oosterhout To: Tom Lane Cc: Ron Peacetree , "Jonah H. Harris" , pgsql-hackers@postgresql.org, pgsql-performance@postgresql.org Subject: Re: [PERFORM] A Better External Sort? Message-ID: <20051006201447.GG10127@svana.org> Reply-To: Martijn van Oosterhout References: <138872.1128556455518.JavaMail.root@elwamui-milano.atl.sa.earthlink.net> <20051006165725.GF10127@svana.org> <25130.1128628658@sss.pgh.pa.us> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="gm5TwAJMO0F2iVRz" Content-Disposition: inline In-Reply-To: <25130.1128628658@sss.pgh.pa.us> User-Agent: Mutt/1.3.28i X-PGP-Key-ID: Length=1024; ID=0x0DC67BE6 X-PGP-Key-Fingerprint: 295F A899 A81A 156D B522 48A7 6394 F08A 0DC6 7BE6 X-PGP-Key-URL: X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.008 required=5 tests=[AWL=0.008] X-Spam-Level: X-Archive-Number: 200510/300 X-Sequence-Number: 74159 --gm5TwAJMO0F2iVRz Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Oct 06, 2005 at 03:57:38PM -0400, Tom Lane wrote: > Martijn van Oosterhout 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... >=20 > 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. =46rom 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 system call table were added in 2.1.69. The libc support (including emulation on older kernels without the system calls) 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. --=20 Martijn van Oosterhout 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. --gm5TwAJMO0F2iVRz Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.6 (GNU/Linux) Comment: For info see http://www.gnupg.org iD8DBQFDRYW2IB7bNG8LQkwRAhq3AJ9nnPQg2JiTBU16YQe00F6lVDeNsQCggoku kFSCCpIm/4BSwiZCmAHkBNI= =xrHy -----END PGP SIGNATURE----- --gm5TwAJMO0F2iVRz--