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 1m6LsE-0005XE-Tm for pgsql-performance@arkaria.postgresql.org; Wed, 21 Jul 2021 23:43:34 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1m6LsD-0002S6-RY for pgsql-performance@arkaria.postgresql.org; Wed, 21 Jul 2021 23:43:33 +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 1m6LsD-0002Rx-JC for pgsql-performance@lists.postgresql.org; Wed, 21 Jul 2021 23:43:33 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1m6LsB-0003i3-Ip for pgsql-performance@postgresql.org; Wed, 21 Jul 2021 23:43:32 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 16LNhRJu732759; Wed, 21 Jul 2021 19:43:28 -0400 From: Tom Lane To: "ldh@laurent-hasson.com" cc: Peter Geoghegan , Justin Pryzby , "pgsql-performance@postgresql.org" Subject: Re: Big performance slowdown from 11.2 to 13.3 In-reply-to: References: <20210721191528.GC19620@telsasoft.com> Comments: In-reply-to "ldh@laurent-hasson.com" message dated "Wed, 21 Jul 2021 23:37:40 -0000" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <732757.1626911007.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Wed, 21 Jul 2021 19:43:27 -0400 Message-ID: <732758.1626911007@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk "ldh@laurent-hasson.com" writes: > From: Peter Geoghegan = >> I imagine that this has something to do with the fact that the hash agg= regate spills to disk in Postgres 13. > So how is this happening? I mean, it's the exact same query, looks like = the same plan to me, it's the same data on the exact same VM etc... Why is= that behavior so different? What Peter's pointing out is that v11 never spilled hashagg hash tables to disk period, no matter how big they got (possibly leading to out-of-memory situations or swapping, but evidently you have enough RAM to have avoided that sort of trouble). I'd momentarily forgotten that, but I think he's dead on about that explaining the difference. As he says, messing with hash_mem_multiplier would be a more targeted fix than increasing work_mem across the board. regards, tom lane