Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1joEem-0005bZ-SE for pgsql-hackers@arkaria.postgresql.org; Wed, 24 Jun 2020 23:18:16 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1joEel-0002ez-O3 for pgsql-hackers@arkaria.postgresql.org; Wed, 24 Jun 2020 23:18:15 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1joEel-0002es-Gz for pgsql-hackers@lists.postgresql.org; Wed, 24 Jun 2020 23:18:15 +0000 Received: from momjian.us ([72.94.173.45]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1joEej-0003ei-1d for pgsql-hackers@postgresql.org; Wed, 24 Jun 2020 23:18:15 +0000 Received: from bruce by momjian.us with local (Exim 4.92) (envelope-from ) id 1joEeg-0004BQ-9n; Wed, 24 Jun 2020 19:18:10 -0400 Date: Wed, 24 Jun 2020 19:18:10 -0400 From: Bruce Momjian To: Andres Freund Cc: David Rowley , Jeff Davis , Robert Haas , Justin Pryzby , Melanie Plageman , Tomas Vondra , "pgsql-hackers@postgresql.org" Subject: Re: Default setting for enable_hashagg_disk Message-ID: <20200624231810.GB13627@momjian.us> References: <8bff2e4e8020c3caa16b61a46918d21b573eaf78.camel@j-davis.com> <129c8f1739957589584d9525e1d8782eae3f412f.camel@j-davis.com> <20200624090628.GA19640@momjian.us> <20200624171203.GB17842@momjian.us> <20200624191900.t4sbfk236gndwoa3@alap3.anarazel.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200624191900.t4sbfk236gndwoa3@alap3.anarazel.de> User-Agent: Mutt/1.10.1 (2018-07-13) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On Wed, Jun 24, 2020 at 12:19:00PM -0700, Andres Freund wrote: > Hi, > > On 2020-06-24 13:12:03 -0400, Bruce Momjian wrote: > > Well, my point is that merge join works that way, and no one has needed > > a knob to avoid mergejoin if it is going to spill to disk. If they are > > adjusting work_mem to prevent spill of merge join, they can do the same > > for hash agg. We just need to document this in the release notes. > > I don't think this is comparable. For starters, the IO indirectly > triggered by mergejoin actually leads to plenty people just straight out > disabling it. For lots of workloads there's never a valid reason to use > a mergejoin (and often the planner will never choose one). Secondly, the > planner has better information about estimating the memory usage for the > to-be-sorted data than it has about the size of the transition > values. And lastly, there's a difference between a long existing cause > for bad IO behaviour and one that's suddenly kicks in after a major > version upgrade, to which there's no escape hatch (it's rarely realistic > to disable hash aggs, in contrast to merge joins). Well, this sounds like an issue of degree, rather than kind. It sure sounds like "ignore work_mem for this join type, but not the other". -- Bruce Momjian https://momjian.us EnterpriseDB https://enterprisedb.com The usefulness of a cup is in its emptiness, Bruce Lee