Received: from localhost (unknown [200.46.208.211]) by mail.postgresql.org (Postfix) with ESMTP id B218C633708 for ; Mon, 11 Jan 2010 16:18:54 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.208.211]) (amavisd-maia, port 10024) with ESMTP id 92209-07 for ; Mon, 11 Jan 2010 20:18:40 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by mail.postgresql.org (Postfix) with ESMTP id 7BE066335A4 for ; Mon, 11 Jan 2010 16:18:43 -0400 (AST) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.2/8.14.2) with ESMTP id o0BKIeZK018804; Mon, 11 Jan 2010 15:18:40 -0500 (EST) To: Jaime Casanova cc: Robert Haas , decibel , psql performance list Subject: Re: [PERFORMANCE] work_mem vs temp files issue In-reply-to: <3073cc9b1001111116x53427c9bm1e448128a3b4f6c6@mail.gmail.com> References: <3073cc9b0908191745o3dc63d95q6b9308ef5bd199f2@mail.gmail.com> <25315.1252881420@sss.pgh.pa.us> <3073cc9b1001111015t3888cbbex7171d61b952218da@mail.gmail.com> <603c8f071001111107v75276375g4d626dfc0efd8dc4@mail.gmail.com> <3073cc9b1001111114j7ddacd56p8966f9d61997a8b@mail.gmail.com> <3073cc9b1001111116x53427c9bm1e448128a3b4f6c6@mail.gmail.com> Comments: In-reply-to Jaime Casanova message dated "Mon, 11 Jan 2010 14:16:38 -0500" Date: Mon, 11 Jan 2010 15:18:40 -0500 Message-ID: <18803.1263241120@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-2.458 tagged_above=-10 required=5 tests=AWL=0.141, BAYES_00=-2.599 X-Spam-Level: X-Archive-Number: 201001/216 X-Sequence-Number: 37096 Jaime Casanova writes: > LOG: begin tuple sort: nkeys = 1, workMem = 1024, randomAccess = f > LOG: switching to bounded heapsort at 641 tuples: CPU 0.08s/0.13u sec elapsed 0.25 sec > LOG: temporary file: path "base/pgsql_tmp/pgsql_tmp8507.5", size 471010 > LOG: temporary file: path "base/pgsql_tmp/pgsql_tmp8507.10", size 81096 > LOG: temporary file: path "base/pgsql_tmp/pgsql_tmp8507.0", size 467373 > LOG: temporary file: path "base/pgsql_tmp/pgsql_tmp8507.9", size 110200 > LOG: temporary file: path "base/pgsql_tmp/pgsql_tmp8507.3", size 470011 > LOG: temporary file: path "base/pgsql_tmp/pgsql_tmp8507.8", size 157192 > LOG: temporary file: path "base/pgsql_tmp/pgsql_tmp8507.4", size 468681 > LOG: temporary file: path "base/pgsql_tmp/pgsql_tmp8507.12", size 101624 > LOG: temporary file: path "base/pgsql_tmp/pgsql_tmp8507.1", size 472285 > LOG: temporary file: path "base/pgsql_tmp/pgsql_tmp8507.11", size 100744 > LOG: temporary file: path "base/pgsql_tmp/pgsql_tmp8507.6", size 467173 > LOG: temporary file: path "base/pgsql_tmp/pgsql_tmp8507.7", size 141888 > LOG: temporary file: path "base/pgsql_tmp/pgsql_tmp8507.2", size 476227 > LOG: temporary file: path "base/pgsql_tmp/pgsql_tmp8507.13", size 89072 > LOG: performsort starting: CPU 0.10s/0.19u sec elapsed 0.33 sec > LOG: performsort done: CPU 0.10s/0.19u sec elapsed 0.33 sec > LOG: internal sort ended, 118 KB used: CPU 0.10s/0.19u sec elapsed 0.33 sec Hmm. Not clear where the temp files are coming from, but it's *not* the sort --- the "internal sort ended" line shows that that sort never went to disk. What kind of plan is feeding the sort node? regards, tom lane