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 1joUsq-0001cv-WB for pgsql-hackers@arkaria.postgresql.org; Thu, 25 Jun 2020 16:37: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 1joUsp-0008Dx-61 for pgsql-hackers@arkaria.postgresql.org; Thu, 25 Jun 2020 16:37:51 +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 1joUso-0008Dp-V6 for pgsql-hackers@lists.postgresql.org; Thu, 25 Jun 2020 16:37:50 +0000 Received: from out2-smtp.messagingengine.com ([66.111.4.26]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1joUsm-0007wg-W5 for pgsql-hackers@postgresql.org; Thu, 25 Jun 2020 16:37:49 +0000 Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.nyi.internal (Postfix) with ESMTP id 24FB05C011A; Thu, 25 Jun 2020 12:37:48 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute3.internal (MEProxy); Thu, 25 Jun 2020 12:37:48 -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=UFrseW7dOi1cZDhQLkwDIF/0P7h A4KV2PX5mUGMJoC4=; b=c6w/WXUWhIHolWFvQf5OkJnnhSJ+bVY61NeU3W4TvKI ILWjRmYcM+InL4VS7IfN2cccZt2wKV9TUcNJF5kiNB/4suYYTnWbR+Gl4/qFQf7v AprGMPz89O7c1cJNbsnQp6CBKysBlqi3dj+xckBN81BewlE8O/YBWbta8dnO//OY PsA+kQx4dAO6KybXSOzyH1xjOB4jfLkx3qwXxo4XglhDQSIgB5UeB83/ie1EaiTv zaLxdkYu27Hanh++JsUd/8sy9BOmQy+ogtbU7sjkXUFgv3KwkFH5vorP+XcS0M5R oaf3pSPlcJDs4BTOHhhsdKNg8D3JO3t79KE8Gaw05Bg== 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=UFrseW 7dOi1cZDhQLkwDIF/0P7hA4KV2PX5mUGMJoC4=; b=KXHxZVzX69tqFJVYimeI5Q FG6ECikUXkZIh9cvHGJAxF79ahjPGC0Lpq4vEyky8pw+Pc1++ny7Xy/BHzO4mRR0 19uqDGMYYflVvuFJ9L2li0/3aM6PzHTWKPS0Le2pEqcXkYHRDaNJe6oPGx2F8cEo 6GBkFG71HSi7T9VMM7vBVOz5AyfQxSThfkCKS2F7dOjgaTSoq0Nfzl7SIl8evmhQ VGRzjsJhpG5q0mi+g9oEPw3TNBk1QsMQePgkE4erEMdB7OjlAoNtlo6/sEcIADu2 cC/VNodUeLVRE2NW4hj3ix/BdAC2ND5fmD6M3q0yfKc/pt7eorijyByR759xdMNw == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduhedrudekledguddtgecutefuodetggdotefrod 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 5BCDD3067809; Thu, 25 Jun 2020 12:37:47 -0400 (EDT) Date: Thu, 25 Jun 2020 09:37:46 -0700 From: Andres Freund To: Jeff Davis Cc: David Rowley , Robert Haas , Justin Pryzby , Melanie Plageman , Tomas Vondra , "pgsql-hackers@postgresql.org" Subject: Re: Default setting for enable_hashagg_disk Message-ID: <20200625163746.laoepc7esanptvxt@alap3.anarazel.de> References: <20200610021544.GA14879@telsasoft.com> <8bff2e4e8020c3caa16b61a46918d21b573eaf78.camel@j-davis.com> <129c8f1739957589584d9525e1d8782eae3f412f.camel@j-davis.com> <20200624191433.5gnqgrxfmucexldm@alap3.anarazel.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 2020-06-25 09:24:52 -0700, Jeff Davis wrote: > On Wed, 2020-06-24 at 12:14 -0700, Andres Freund wrote: > > E.g. if the plan isn't expected to spill, > > only spill at 10 x work_mem or something like that. > > Let's say you have work_mem=32MB and a query that's expected to use > 16MB of memory. In reality, it uses 64MB of memory. So you are saying > this query would get to use all 64MB of memory, right? > > But then you run ANALYZE. Now the query is (correctly) expected to use > 64MB of memory. Are you saying this query, executed again with better > stats, would only get to use 32MB of memory, and therefore run slower? Yes. I think that's ok, because it was taken into account from a costing perspective int he second case.