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 290A5D829A for ; Wed, 5 Oct 2005 07:49:17 -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 64141-03 for ; Wed, 5 Oct 2005 10:49:13 +0000 (GMT) Received: from svana.org (svana.org [203.20.62.76]) by svr1.postgresql.org (Postfix) with ESMTP id 707D5D6F63 for ; Wed, 5 Oct 2005 07:49:14 -0300 (ADT) Received: from kleptog by svana.org with local (Exim 3.35 #1 (Debian)) id 1EN6pp-0003sv-00; Wed, 05 Oct 2005 20:49:17 +1000 Date: Wed, 5 Oct 2005 12:49:17 +0200 From: Martijn van Oosterhout To: pgsql-hackers@postgresql.org Subject: Re: [PERFORM] A Better External Sort? Message-ID: <20051005104916.GC12206@svana.org> Reply-To: Martijn van Oosterhout References: <25552174.1128176560482.JavaMail.root@elwamui-polski.atl.sa.earthlink.net> <20051001161936.GE13830@svana.org> <20051005094125.GW2241@mathom.us> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="MnLPg7ZWsaic7Fhd" Content-Disposition: inline In-Reply-To: <20051005094125.GW2241@mathom.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/207 X-Sequence-Number: 74066 --MnLPg7ZWsaic7Fhd Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Oct 05, 2005 at 05:41:25AM -0400, Michael Stone wrote: > On Sat, Oct 01, 2005 at 06:19:41PM +0200, Martijn van Oosterhout wrote: > >COPY TO /dev/null WITH binary > >13MB/s 55% user 45% system (ergo, CPU bound) > [snip] > >the most expensive. But it does point out that the whole process is > >probably CPU bound more than anything else. >=20 > Note that 45% of that cpu usage is system--which is where IO overhead > would end up being counted. Until you profile where you system time is > going it's premature to say it isn't an IO problem. It's a dual CPU system, so 50% is the limit for a single process. Since system usage < user, PostgreSQL is the limiter. Sure, the system is taking a lot of time, but PostgreSQL is still the limiting factor. Anyway, the later measurements using gprof exclude system time altogether and it still shows CPU being the limiting factor. Fact is, extracting tuples from pages is expensive. --=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. --MnLPg7ZWsaic7Fhd 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 iD8DBQFDQ6+rIB7bNG8LQkwRAtX6AKCNa7sgu1nH5L01TE02lcH2rdk2/wCfaeP1 i2wioGSUf1rEbRJjZLtuTL0= =zdXF -----END PGP SIGNATURE----- --MnLPg7ZWsaic7Fhd--