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 1m6cEX-0006Mg-3G for pgsql-performance@arkaria.postgresql.org; Thu, 22 Jul 2021 17:11:41 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1m6cEV-0000zw-Py for pgsql-performance@arkaria.postgresql.org; Thu, 22 Jul 2021 17:11:39 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1m6cEV-0000zo-Hb for pgsql-performance@lists.postgresql.org; Thu, 22 Jul 2021 17:11:39 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1m6cET-0001La-LH for pgsql-performance@postgresql.org; Thu, 22 Jul 2021 17:11:39 +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 16MHBXfU789414; Thu, 22 Jul 2021 13:11:33 -0400 From: Tom Lane To: Peter Geoghegan cc: David Rowley , "ldh@laurent-hasson.com" , 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> <732758.1626911007@sss.pgh.pa.us> <784576.1626968702@sss.pgh.pa.us> <785218.1626969409@sss.pgh.pa.us> <786600.1626970898@sss.pgh.pa.us> <787780.1626972122@sss.pgh.pa.us> Comments: In-reply-to Peter Geoghegan message dated "Thu, 22 Jul 2021 10:04:31 -0700" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <789412.1626973893.1@sss.pgh.pa.us> Date: Thu, 22 Jul 2021 13:11:33 -0400 Message-ID: <789413.1626973893@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Peter Geoghegan writes: > I also suspect that if Laurent set work_mem and/or hash_mem_multiplier > *extremely* aggressively, then eventually the hash agg would be > in-memory. And without actually using all that much memory. No, he already tried, upthread. The trouble is that he's on a Windows machine, so get_hash_mem is quasi-artificially constraining the product to 2GB. And he needs it to be a bit more than that. Whether the constraint is hitting at the ngroups stage or it's related to actual memory consumption isn't that relevant. What I'm wondering about is whether it's worth putting in a solution for this issue in isolation, or whether we ought to embark on the long-ignored project of getting rid of use of "long" for any memory-size-related computations. There would be no chance of back-patching something like the latter into v13, though. regards, tom lane