Received: from maia.hub.org (unknown [200.46.204.183]) by mail.postgresql.org (Postfix) with ESMTP id 17B43633AF9 for ; Wed, 13 Jan 2010 02:32:11 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 85942-03 for ; Wed, 13 Jan 2010 06:32:00 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from mail-bw0-f213.google.com (mail-bw0-f213.google.com [209.85.218.213]) by mail.postgresql.org (Postfix) with ESMTP id 4DEAD633ACE for ; Wed, 13 Jan 2010 02:32:00 -0400 (AST) Received: by bwz5 with SMTP id 5so15185874bwz.3 for ; Tue, 12 Jan 2010 22:31:58 -0800 (PST) MIME-Version: 1.0 Received: by 10.204.5.75 with SMTP id 11mr632002bku.20.1263364318241; Tue, 12 Jan 2010 22:31:58 -0800 (PST) In-Reply-To: <18803.1263241120@sss.pgh.pa.us> 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> <18803.1263241120@sss.pgh.pa.us> From: Jaime Casanova Date: Wed, 13 Jan 2010 01:31:43 -0500 Message-ID: <3073cc9b1001122231m1a15d187lae2a8096a813361b@mail.gmail.com> Subject: Re: [PERFORMANCE] work_mem vs temp files issue To: Tom Lane Cc: Robert Haas , decibel , psql performance list Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.589 tagged_above=-10 required=5 tests=BAYES_00=-2.599, FH_DATE_PAST_20XX=3.188 X-Spam-Level: X-Archive-Number: 201001/242 X-Sequence-Number: 37122 On Mon, Jan 11, 2010 at 3:18 PM, Tom Lane wrote: > > Hmm. =C2=A0Not 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. =C2=A0What kind of plan is feeding the sort node? > some time ago, you said: """ It might be useful to turn on trace_sort to see if the small files are coming from sorts. If they're from hashes I'm afraid there's no handy instrumentation ... """ and is clearly what was bother me... because most of all temp files are coming from hash... why we don't show some of that info in explain? for example: we can show memory used, no? or if the hash goes to disk... if i remove #ifdef HJDEBUG seems like we even know how many batchs the hash used... the reason i say "most of the temp files" is that when i removed #ifdef HJDEBUG it says that in total i was using 10 batchs but there were 14 temp files created (i guess we use 1 file per batch, no?) """ nbatch =3D 1, nbuckets =3D 1024 nbatch =3D 1, nbuckets =3D 1024 nbatch =3D 8, nbuckets =3D 2048 """ --=20 Atentamente, Jaime Casanova Soporte y capacitaci=C3=B3n de PostgreSQL Asesor=C3=ADa y desarrollo de sistemas Guayaquil - Ecuador Cel. +59387171157