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 1joXUT-00069f-9T for pgsql-hackers@arkaria.postgresql.org; Thu, 25 Jun 2020 19:24:53 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1joXUS-00086J-3t for pgsql-hackers@arkaria.postgresql.org; Thu, 25 Jun 2020 19:24:52 +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 1joXUR-0007mR-Lj for pgsql-hackers@lists.postgresql.org; Thu, 25 Jun 2020 19:24:51 +0000 Received: from momjian.us ([72.94.173.45]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1joXUL-000197-9Z for pgsql-hackers@postgresql.org; Thu, 25 Jun 2020 19:24:50 +0000 Received: from bruce by momjian.us with local (Exim 4.92) (envelope-from ) id 1joXUI-0001uJ-6n; Thu, 25 Jun 2020 15:24:42 -0400 Date: Thu, 25 Jun 2020 15:24:42 -0400 From: Bruce Momjian To: Jeff Davis Cc: Tom Lane , Justin Pryzby , David Rowley , Robert Haas , Melanie Plageman , Tomas Vondra , pgsql-hackers@postgresql.org Subject: Re: Default setting for enable_hashagg_disk Message-ID: <20200625192442.GD12486@momjian.us> References: <8bff2e4e8020c3caa16b61a46918d21b573eaf78.camel@j-davis.com> <129c8f1739957589584d9525e1d8782eae3f412f.camel@j-davis.com> <20200624090628.GA19640@momjian.us> <20200624123843.GX4107@telsasoft.com> <2214502.1593019796@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On Thu, Jun 25, 2020 at 11:10:58AM -0700, Jeff Davis wrote: > On Wed, 2020-06-24 at 13:29 -0400, Tom Lane wrote: > > If we feel we need something to let people have the v12 behavior > > back, let's have > > (1) enable_hashagg on/off --- controls planner, same as it ever was > > (2) enable_hashagg_spill on/off --- controls executor by disabling > > spill > > > > But I'm not really convinced that we need (2). > > If we're not going to have a planner GUC, one alternative is to just > penalize the disk costs of HashAgg for a release or two. It would only > affect the cost of HashAgg paths that are expected to spill, which > weren't even generated in previous releases. > > In other words, multiply the disk costs by enough that the planner will > usually not choose HashAgg if expected to spill unless the average > group size is quite large (i.e. there are a lot more tuples than > groups, but still enough groups to spill). Well, the big question is whether this costing is actually more accurate than what we have now. What I am hearing is that spilling hash agg is expensive, so whatever we can do to reflect the actual costs seems like a win. If it can be done, it certainly seems better than a cost setting few people will use. -- Bruce Momjian https://momjian.us EnterpriseDB https://enterprisedb.com The usefulness of a cup is in its emptiness, Bruce Lee