Skip site navigation (1) Skip section navigation (2)

Re: [PERFORMANCE] work_mem vs temp files issue

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Jaime Casanova <jcasanov(at)systemguards(dot)com(dot)ec>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, decibel <decibel(at)decibel(dot)org>, psql performance list <pgsql-performance(at)postgresql(dot)org>
Subject: Re: [PERFORMANCE] work_mem vs temp files issue
Date: 2010-01-13 15:23:32
Message-ID: 603c8f071001130723v634cb3c3u1604ea69efb04e91@mail.gmail.com (view raw or flat)
Thread:
Lists: pgsql-performance
On Wed, Jan 13, 2010 at 1:31 AM, Jaime Casanova
<jcasanov(at)systemguards(dot)com(dot)ec> wrote:
> On Mon, Jan 11, 2010 at 3:18 PM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)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

In response to

Responses

pgsql-performance by date

Next:From: Tom LaneDate: 2010-01-13 15:42:38
Subject: Re: [PERFORMANCE] work_mem vs temp files issue
Previous:From: Tom LaneDate: 2010-01-13 14:45:11
Subject: Re: [PERFORMANCE] work_mem vs temp files issue

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group