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 1joUgN-0001Ds-Hv for pgsql-hackers@arkaria.postgresql.org; Thu, 25 Jun 2020 16:24:59 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1joUgM-0003Sj-Ff for pgsql-hackers@arkaria.postgresql.org; Thu, 25 Jun 2020 16:24:58 +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 1joUgM-0003SV-7S for pgsql-hackers@lists.postgresql.org; Thu, 25 Jun 2020 16:24:58 +0000 Received: from mail-pl1-x641.google.com ([2607:f8b0:4864:20::641]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1joUgK-0007gf-0w for pgsql-hackers@postgresql.org; Thu, 25 Jun 2020 16:24:57 +0000 Received: by mail-pl1-x641.google.com with SMTP id k6so2994795pll.9 for ; Thu, 25 Jun 2020 09:24:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=j-davis-com.20150623.gappssmtp.com; s=20150623; h=message-id:subject:from:to:cc:date:in-reply-to:references :mime-version:content-transfer-encoding; bh=9IfenO1YIipCsC3S5w5DcBv7JR73cKWNbGvRWW2ckwA=; b=nIS9oZKDi3iK2kLoUUL+LWkXOLB2EaMJxtYioo4TEC/YQcqTY3/vbPIX8cpKrWhb81 FxwOtTmpzkkZtoS89NauJKaLGnXqGg5+bzRcZjvCvtPAv005v9c9IrEIhcr+ktK8Lp4v hJYe2JMLXG7+Zv17VCrtOGZsHjsUpVfPsi18d/vyXX/PZpx+GoBjvDUMRzpx7bFc1b0S J8/xYGZGlUnJphtNrDBy+nmn27M/CBMqWEdbzfKzu6cT0uhl3XQMU5j4Qrd8QxXrA945 zpIYSV9Nx7+57AYp6fAt4LcaOfXK2Ky4v4BKRtckXe2pdk9Sh90dHv9PnA81Jk3LpMB+ iyYw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:message-id:subject:from:to:cc:date:in-reply-to :references:mime-version:content-transfer-encoding; bh=9IfenO1YIipCsC3S5w5DcBv7JR73cKWNbGvRWW2ckwA=; b=DsxZkaAf9ySm9a9bnQ3c7OjLyL6ur9HG15E8VMtDzn3tpEyIvo+Gs/lzzb+DAEjrNv Tl/dQd8TF3QUlIi5fFJSoBdnnQI38quo6WMbDQmzryqMc/ckjzKefyyzO+3Qah+ocF1p dYyUxUxFmy4JkMHigYk2exCbNq5x9nFTpwJl+va0+uVNCQO4Y4BJk8aPGN6NmsRGAZhI NUyZQX3hXnDYQ0anoAOdbSNJ9BJ3OcTz76iy6XmUw/1OAfQkPD8zvtTIBJvuBuYKtX9U 63j5zZWZuzsQz7XWlI7G+/wGHciAIXiotja8YxDtPx/34FY1pSpcOSKb6MxhDJ1A5Ch0 2KRQ== X-Gm-Message-State: AOAM533QFCQhDGsU9HViEX9HMokt3tXDqzZmUrM4v3egQrzfnWXz8KwB o6Of/WB7gEfiHLEni92IARNT9A== X-Google-Smtp-Source: ABdhPJxAHDnYIjTWBlQKnMDt++xzHHNgTcSm4DUQMYNjDyLyuJhaFtrTZlYuC5Wzej61VJmUMZkNUA== X-Received: by 2002:a17:902:9b8d:: with SMTP id y13mr14189664plp.322.1593102294933; Thu, 25 Jun 2020 09:24:54 -0700 (PDT) Received: from jdavis.lan (c-73-231-146-4.hsd1.ca.comcast.net. [73.231.146.4]) by smtp.gmail.com with ESMTPSA id o1sm9187167pja.49.2020.06.25.09.24.53 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 25 Jun 2020 09:24:54 -0700 (PDT) Message-ID: Subject: Re: Default setting for enable_hashagg_disk From: Jeff Davis To: Andres Freund , David Rowley Cc: Robert Haas , Justin Pryzby , Melanie Plageman , Tomas Vondra , "pgsql-hackers@postgresql.org" Date: Thu, 25 Jun 2020 09:24:52 -0700 In-Reply-To: <20200624191433.5gnqgrxfmucexldm@alap3.anarazel.de> References: <6292f5a766198d5745eb8cc17ac736366056671d.camel@j-davis.com> <20200610021544.GA14879@telsasoft.com> <8bff2e4e8020c3caa16b61a46918d21b573eaf78.camel@j-davis.com> <129c8f1739957589584d9525e1d8782eae3f412f.camel@j-davis.com> <20200624191433.5gnqgrxfmucexldm@alap3.anarazel.de> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.28.5-0ubuntu0.18.04.2 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk 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? Regards, Jeff Davis