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 1joAvK-00071d-2D for pgsql-hackers@arkaria.postgresql.org; Wed, 24 Jun 2020 19:19:06 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1joAvI-0003iI-QM for pgsql-hackers@arkaria.postgresql.org; Wed, 24 Jun 2020 19:19:04 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1joAvI-0003iB-Jf for pgsql-hackers@lists.postgresql.org; Wed, 24 Jun 2020 19:19:04 +0000 Received: from out3-smtp.messagingengine.com ([66.111.4.27]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1joAvG-0002Kx-Hh for pgsql-hackers@postgresql.org; Wed, 24 Jun 2020 19:19:03 +0000 Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.nyi.internal (Postfix) with ESMTP id E30C85C0152; Wed, 24 Jun 2020 15:19:01 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute3.internal (MEProxy); Wed, 24 Jun 2020 15:19:01 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=anarazel.de; h= date:from:to:cc:subject:message-id:references:mime-version :content-type:in-reply-to; s=fm1; bh=2LoFl9YsniNh5k9XQyqDbO1jCx2 XAJ12eRIbW70zfuM=; b=M6WFylgov3A4j2hPUOWwP56chWO68a2bv6JlrnK2Qil VVvPAWTXwlhxnOb9oXzp2xIzmqKhJtn7mT1wue9+w4x/xC87dzGM8XT4dgDJPmMO /SkzPWR0ojW2ml+6igyQhqMYZFw0rgJebe5bcwyw2X1fr6ylD1sUlwn9lUcODA/a m0PozR4/OFlLm3qrUvEelGTuPYef4TQSizOfzCJZpuV4ybE63gMTl6Qh4o3an0aQ wcbNmQSBRbgquqjUhdV7/4hrK6PNE6z30sB9E8ryZX2BDRDmrNcwMCu1daOQtOvF kQEworoGfLhb+PVLbqhzO94fAMn9ytKObPqn8ni7y9g== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm3; bh=2LoFl9 YsniNh5k9XQyqDbO1jCx2XAJ12eRIbW70zfuM=; b=XGH0ln08iFxkHCbYX3AF/4 cBV660O5SzvPELaAniyjZfN6FA+yBX8UakjiNzjV9cPlHIuL1cDYQ0Cn6eRR07Kc iqC8l2gfCARW2KK+e2aAgZ+Az6iBN2F15moiQvH8/IXijGWBAS9hGDLgeBXET9CC W7vLsO2mTQls4mrSAR6p4w3/ibYdVg2F8fnJmZtJDNn/H/B8q8cplmiO6ZFLCctZ CAjkRlgAKwmM1yblzyjxlQswb8jXFa2BMTZKEQI/fE8/m3QCRN1WWzhA2bTw/jFY unzZlaIyGanIQuOzWrg+A6Zus7Gq6ITJXmy8B5kbGBJJToJPYXICxEnyA1wGC7nA == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduhedrudekjedgudeftdcutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpeffhffvuffkfhggtggujgesthdtredttddtvdenucfhrhhomheptehnughr vghsucfhrhgvuhhnugcuoegrnhgurhgvshesrghnrghrrgiivghlrdguvgeqnecuggftrf grthhtvghrnhepudekhfekleeugeevteehleffffejgeelueduleeffeeutdelffeujeff hfeuffdunecukfhppeeijedrudeitddrvddujedrvdehtdenucevlhhushhtvghrufhiii gvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegrnhgurhgvshesrghnrghrrgiivghl rdguvg X-ME-Proxy: Received: from intern.anarazel.de (c-67-160-217-250.hsd1.ca.comcast.net [67.160.217.250]) by mail.messagingengine.com (Postfix) with ESMTPA id 1B0C4328005D; Wed, 24 Jun 2020 15:19:01 -0400 (EDT) Date: Wed, 24 Jun 2020 12:19:00 -0700 From: Andres Freund To: Bruce Momjian 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: <20200624191900.t4sbfk236gndwoa3@alap3.anarazel.de> References: <20200610021544.GA14879@telsasoft.com> <8bff2e4e8020c3caa16b61a46918d21b573eaf78.camel@j-davis.com> <129c8f1739957589584d9525e1d8782eae3f412f.camel@j-davis.com> <20200624090628.GA19640@momjian.us> <20200624171203.GB17842@momjian.us> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200624171203.GB17842@momjian.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk 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). Greetings, Andres Freund