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 1hpQKw-0003sS-IP for pgsql-hackers@arkaria.postgresql.org; Mon, 22 Jul 2019 04:54:10 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1hpQKv-0002i1-Aq for pgsql-hackers@arkaria.postgresql.org; Mon, 22 Jul 2019 04:54:09 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hpQKv-0002gw-0g for pgsql-hackers@lists.postgresql.org; Mon, 22 Jul 2019 04:54:09 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hpQKs-00037Z-TH for pgsql-hackers@lists.postgresql.org; Mon, 22 Jul 2019 04:54:08 +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 x6M4s0nO029777; Mon, 22 Jul 2019 00:54:00 -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> <29072.1563770256@sss.pgh.pa.us> Comments: In-reply-to David Rowley message dated "Mon, 22 Jul 2019 16:46:02 +1200" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <29775.1563771240.1@sss.pgh.pa.us> Date: Mon, 22 Jul 2019 00:54:00 -0400 Message-ID: <29776.1563771240@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 16:37, Tom Lane wrote: >> Interesting. I wonder if bms_next_member() could be made any quicker? > I had a quick look earlier and the only thing I saw was maybe to do > the first loop differently from subsequent ones. The "w &= mask;" > does nothing useful once we're past the first bitmapword that the loop > touches. Good thought, but it would only help when we're actually iterating to later words, which happens just 1 out of 64 times in the fully- populated-bitmap case. Still, I think it might be worth pursuing to make the sparse-bitmap case faster. regards, tom lane