Re: [PERFORMANCE] work_mem vs temp files issue - Mailing list pgsql-performance

From Robert Haas
Subject Re: [PERFORMANCE] work_mem vs temp files issue
Date
Msg-id 603c8f071001130723v634cb3c3u1604ea69efb04e91@mail.gmail.com
Whole thread Raw
In response to Re: [PERFORMANCE] work_mem vs temp files issue  (Jaime Casanova <jcasanov@systemguards.com.ec>)
Responses Re: [PERFORMANCE] work_mem vs temp files issue
List pgsql-performance
On Wed, Jan 13, 2010 at 1:31 AM, Jaime Casanova
<jcasanov@systemguards.com.ec> wrote:
> On Mon, Jan 11, 2010 at 3:18 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>>
>> 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?
>>
>
> 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...

I had an idea at one point of making explain show the planned and
actual # of batches for each hash join.  I believe that "actual # of
batches > 1" is isomorphic to "hash join went to disk".  The code is
actually pretty easy; the hard part is figuring out what to do about
the UI.  The choices seem to be:

1. Create a new EXPLAIN option just for this - what would we call it?
2. Think of some more, similar things and come up with a new EXPLAIN
option covering all of them - what else would go along with?
3. Sandwhich it into an existing EXPLAIN option, most likely VERBOSE.
4. Display it by default.

...Robert

pgsql-performance by date:

Previous
From: Tom Lane
Date:
Subject: Re: [PERFORMANCE] work_mem vs temp files issue
Next
From: Tom Lane
Date:
Subject: Re: [PERFORMANCE] work_mem vs temp files issue