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 1hpQ54-00032e-Ob for pgsql-hackers@arkaria.postgresql.org; Mon, 22 Jul 2019 04:37:46 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1hpQ53-0002Vr-CW for pgsql-hackers@arkaria.postgresql.org; Mon, 22 Jul 2019 04:37:45 +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 1hpQ53-0002S7-0m for pgsql-hackers@lists.postgresql.org; Mon, 22 Jul 2019 04:37:45 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.92) (envelope-from ) id 1hpQ50-0001re-Kt for pgsql-hackers@lists.postgresql.org; Mon, 22 Jul 2019 04:37:43 +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 x6M4barR029073; Mon, 22 Jul 2019 00:37:36 -0400 From: Tom Lane To: David Rowley cc: Jesper Pedersen , Andres Freund , Robert Haas , PostgreSQL Hackers Subject: Re: POC: converting Lists into arrays In-reply-to: References: <481.1551390571@sss.pgh.pa.us> <24783.1551568303@sss.pgh.pa.us> <20190303043424.itzy3ge52xrkpmpr@alap3.anarazel.de> <437.1551637744@sss.pgh.pa.us> <12684.1551723095@sss.pgh.pa.us> <20190304190612.vgqqsowzkrh22623@alap3.anarazel.de> <26464.1551734920@sss.pgh.pa.us> <20190304221101.hdg4vj5fo4eewh3b@alap3.anarazel.de> <20190304235402.nod3gbotk2qtd4nh@alap3.anarazel.de> <1131.1551746172@sss.pgh.pa.us> <14626.1558745627@sss.pgh.pa.us> <29297.1558799327@sss.pgh.pa.us> <25178.1562006685@sss.pgh.pa.us> <25258.1562023641@sss.pgh.pa.us> <2305.1562181615@sss.pgh.pa.us> <21272.1563318411@sss.pgh.pa.us> <1733.1563720332@sss.pgh.pa.us> Comments: In-reply-to David Rowley message dated "Mon, 22 Jul 2019 13:15:06 +1200" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <29071.1563770256.1@sss.pgh.pa.us> Date: Mon, 22 Jul 2019 00:37:36 -0400 Message-ID: <29072.1563770256@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk David Rowley writes: > On Mon, 22 Jul 2019 at 02:45, Tom Lane wrote: >> One small question is whether it loses if most of the subplans >> are present in the bitmap. I imagine that would be close enough >> to break-even, but it might be worth trying to test to be sure. > ... > -- Test 2 (all matching subplans (8192 of them)) -- > Master version: > Time: 14825.304 ms (00:14.825) > Time: 14701.601 ms (00:14.702) > Time: 14650.969 ms (00:14.651) > Patched version: > Time: 44551.811 ms (00:44.552) > Time: 44357.915 ms (00:44.358) > Time: 43454.958 ms (00:43.455) > So the bms_next_member() loop is slower when the bitmapset is fully > populated with all subplans, but way faster when there's just 1 > member. Interesting. I wonder if bms_next_member() could be made any quicker? Still, I agree that this is negligible compared to the actual work needed per live subplan, and the fact that the cost scales per live subplan is a good thing. So no objection to this patch, but a mental note to take another look at bms_next_member() someday. regards, tom lane