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 28A1EDA3DC; Thu, 6 Oct 2005 13:58:01 -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 54149-07; Thu, 6 Oct 2005 16:57:55 +0000 (GMT) Received: from svana.org (svana.org [203.20.62.76]) by svr1.postgresql.org (Postfix) with ESMTP id 48F24DA3B1; Thu, 6 Oct 2005 13:57:54 -0300 (ADT) Received: from kleptog by svana.org with local (Exim 3.35 #1 (Debian)) id 1ENZ3j-0004kx-00; Fri, 07 Oct 2005 02:57:31 +1000 Date: Thu, 6 Oct 2005 18:57:30 +0200 From: Martijn van Oosterhout To: Ron Peacetree Cc: "Jonah H. Harris" , pgsql-hackers@postgresql.org, pgsql-performance@postgresql.org Subject: Re: [PERFORM] A Better External Sort? Message-ID: <20051006165725.GF10127@svana.org> Reply-To: Martijn van Oosterhout References: <138872.1128556455518.JavaMail.root@elwamui-milano.atl.sa.earthlink.net> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="gdTfX7fkYsEEjebm" Content-Disposition: inline In-Reply-To: <138872.1128556455518.JavaMail.root@elwamui-milano.atl.sa.earthlink.net> 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/287 X-Sequence-Number: 74146 --gdTfX7fkYsEEjebm Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Oct 05, 2005 at 07:54:15PM -0400, Ron Peacetree wrote: > I asked some questions about physical layout and format translation > overhead being possibly suboptimal that seemed to be agreed to, but > specifics as to where we are taking the hit don't seem to have been > made explicit yet. This hit is easy to see and terribly hard to do anything about at the same time. Any single row in a table stores its values but the offsets arn't constant. If a field is NULL, it is skipped. If a field is variable length, you have to look at the length before you can jump over to the next value. If you have no NULLs and no variable length fields, then you can optimise access. This is already done and it's hard to see how you could improve it further. To cut costs, many places use heap_deform_tuple and similar routines so that the costs are reduced, but they're still there. Upping the data transfer rate from disk is a worthy goal, just some people beleive it is of lower priority than improving CPU usage. > We were also told that evidently we are CPU bound far before one > would naively expect to be based on the performance specifications > of the components involved. As someone pointed out, calls to the C library are not counted seperately, making it harder to see if we're overcalling some of them. Pinpointing the performance bottleneck is hard work. > Now I've asked for the quickest path to detailed understanding of the > pg IO subsystem. The goal being to get more up to speed on its > coding details. Certainly not to annoy you or anyone else. Well, the work is all in storage/smgr and storage/file. It's not terribly complicated, it just sometimes takes a while to understand *why* it is done this way. 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... But it's been a productive thread, absolutly. Progress has been made... Have a nice day, --=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. --gdTfX7fkYsEEjebm 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 iD8DBQFDRVd0IB7bNG8LQkwRApCLAJ0ezBpzEpD8ubpKGjEjhhcPq5Oo6gCdGtZc q22gs+81mm52zQpPhUScJHA= =EN7M -----END PGP SIGNATURE----- --gdTfX7fkYsEEjebm--