Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1ielW9-0000NJ-Gd for pgsql-bugs@arkaria.postgresql.org; Tue, 10 Dec 2019 19:49:57 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1ielW8-00077l-9Q for pgsql-bugs@arkaria.postgresql.org; Tue, 10 Dec 2019 19:49:56 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1ielW7-00077e-UH for pgsql-bugs@lists.postgresql.org; Tue, 10 Dec 2019 19:49:56 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ielW1-0003cx-5u for pgsql-bugs@lists.postgresql.org; Tue, 10 Dec 2019 19:49:54 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id xBAJng3R008526; Tue, 10 Dec 2019 14:49:42 -0500 From: Tom Lane To: Tomas Vondra cc: Alvaro Herrera , Thomas Munro , Andres Freund , James Coleman , PostgreSQL mailing lists Subject: Re: BUG #16104: Invalid DSA Memory Alloc Request in Parallel Hash In-reply-to: <20191210173224.y5vaam6ep7pjmddt@development> References: <20191203170704.GA28076@alvherre.pgsql> <20191210173224.y5vaam6ep7pjmddt@development> Comments: In-reply-to Tomas Vondra message dated "Tue, 10 Dec 2019 18:32:24 +0100" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <8524.1576007382.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Tue, 10 Dec 2019 14:49:42 -0500 Message-ID: <8525.1576007382@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Tomas Vondra writes: > As for the performance impact, I did this: > create table dim (id int, val text); > insert into dim select i, md5(i::text) from generate_series(1,1000000= ) s(i); > create table fact (id int, val text); > insert into fact select mod(i,1000000)+1, md5(i::text) from generate_= series(1,25000000) s(i); > set max_parallel_workers_per_gather =3D 0; > select count(*) from fact join dim using (id); > So a perfectly regular join between 1M and 25M table. On my machine, > this takes ~8851ms on master and 8979ms with the patch (average of about > 20 runs with minimal variability). That's ~1.4% regression, so a bit > more than the 0.4% mentioned before. Not a huge difference though, and > some of it might be due to different binary layout etc. Hmm ... I replicated this experiment here, using my usual precautions to get more-or-less-reproducible numbers [1]. I concur that the patch seems to be slower, but only by around half a percent on the median numbers, which is much less than the run-to-run variation. So that would be fine --- except that in my first set of runs, I forgot the "set max_parallel_workers_per_gather" step and hence tested this same data set with a parallel hash join. And in that scenario, I got a repeatable slowdown of around 7.5%, which is far above the noise floor. So that's not good --- why does this change make PHJ worse? regards, tom lane [1] https://www.postgresql.org/message-id/31686.1574722301%40sss.pgh.pa.us