Received: from makus.postgresql.org (makus.postgresql.org [98.129.198.125]) by mail.postgresql.org (Postfix) with ESMTP id 359EB723EDA for ; Sun, 20 Nov 2011 12:12:14 -0400 (AST) Received: from wizmail.org ([217.146.107.12]) by makus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1RSA04-0007mc-W1 for pgsql-performance@postgresql.org; Sun, 20 Nov 2011 16:12:14 +0000 Received: from trunk.jgh.adsl.wizards.co.uk ([217.146.123.57] helo=ebony.jgh.adsl.wizards.co.uk) from_AS 16353 by wizmail.org with esmtpsa (TLSv1:DHE-RSA-CAMELLIA256-SHA:256) (Exim 4.77) id 1RS9zq-0006kc-1g (return-path ); Sun, 20 Nov 2011 16:11:58 +0000 Message-ID: <4EC926C9.1030409@wizmail.org> Date: Sun, 20 Nov 2011 16:11:53 +0000 From: Jeremy Harris User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.21) Gecko/20090320 Fedora/2.0.0.21-1.fc9 Thunderbird/2.0.0.21 Mnenhy/0.7.5.0 MIME-Version: 1.0 To: pgsql-performance@postgresql.org Subject: Re: external sort performance References: <4EC906FE.5040902@wizmail.org> In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Archive-Number: 201111/250 X-Sequence-Number: 45761 On 2011-11-20 15:00, Jon Nelson wrote: > Do you happen to recall if disk I/O is > counted as user or system time? Neither, traditionally. Those times are cpu times; they only account for what the cpu was doing. The disks could be working in parallel as a result of cpu actions, and probably were - but the software found work to do for the cpu. You'd want to be looking at iostat during the run to see how busy the disks were. As to why it takes 16 hours cpu to do the external version but only 34 minutes for internal - some of that will be down to data-shuffling in- and out- of disk files which is nonetheless accounted to user-mode cpu time, but some will be the plain inefficiency of the external version having to effectively do work over many times because it can't have a complete view of the problem at hand at any one time. -- Jeremy