Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1wF06P-004eX6-0C for pgsql-hackers@arkaria.postgresql.org; Tue, 21 Apr 2026 01:40:37 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1wF06O-005G3P-01 for pgsql-hackers@arkaria.postgresql.org; Tue, 21 Apr 2026 01:40:36 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1wF06N-005G3G-2I for pgsql-hackers@lists.postgresql.org; Tue, 21 Apr 2026 01:40:35 +0000 Received: from mail-wr1-x436.google.com ([2a00:1450:4864:20::436]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1wF06L-000000020gE-193P for pgsql-hackers@lists.postgresql.org; Tue, 21 Apr 2026 01:40:34 +0000 Received: by mail-wr1-x436.google.com with SMTP id ffacd0b85a97d-43d73352cf2so3125491f8f.1 for ; Mon, 20 Apr 2026 18:40:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1776735631; cv=none; d=google.com; s=arc-20240605; b=RQdoQyG70mOWVDayIvXXCNX509KVXaqgy6iPKUL6nhCfpKaES8xqXPsUwAK3CKk1Li a0PtW4ThNxvrEvhy96ibA72bAGSnWLtgSK1M6Sy2+/UwX9VLPVzOOyB6hCDcYeMJowfn FBPKGqy4WrGzt9/QWGwIDjWPyPAMEUzVYQp5A92cxZ1IjJUV+qNhvlgmkBCduWWO2n/m WoHxeIpQoajZfveGylaUWqw4LWBy9jlNVId272s0pGqkDkspXQJJBV1qqa4SpbQFqm7k fxGWGBvny6vV9tYMbEtBLcVmaDhNVTCCAIEMJnPawCVu3wtEP/zaQqJL2V/N6xc3FlRh 0Sug== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:dkim-signature; bh=K2zGS7szlnxtf2CAjUVWjJKVS/xd/C/u9KRYIR0r7sg=; fh=k4YxX4dv+rrlM37R1mXtJeQUDdPTd3xzGtA1Z7ufZpg=; b=UwzALBUFQ0QDeHjl8XcVfwqw7hvvcUfUtuyCxOIK11LDm1OvPaJD6XVEq9+0RhiS5P EJAGO1e4UdUZ0WNzSK6/UVYUtq3GULuxLmp4eHkJW4kA/wMfEcz6GxLiySR2vgkk+i0b 9IeGbG2x+sGXX1Y3gzTxhnlZanRM/2nKLdYGIrcdO35elhWEoqNxrzVmRJAXpHWVFaUs AYfjxq3LVYfR/CpU8Q6FN6hJ7Ip2N/ZE1oUL0aHWod6w813T+BHf6pGk4/daWBUuf7ug YkgHxI9jbZ0n7Klj0bM4KEn3YxfJ4dM1Yzc7doON14h4m103AxTX1f3mEoLHn6qneoxd lb/Q==; darn=lists.postgresql.org ARC-Authentication-Results: i=1; mx.google.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1776735631; x=1777340431; darn=lists.postgresql.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=K2zGS7szlnxtf2CAjUVWjJKVS/xd/C/u9KRYIR0r7sg=; b=JTvAjn2zvMAlWZYEgtgEYpfydOU3DB5vC80R13Gm3xjbblC4aKTsbDKevgiXFmUN/p aMRJs8zIfjuPKdyC6h/909M7HvxnwqNr9ka5RrKxRV/bO9q2OIuNQ9w+RtRQHamENqES lizcqi8JDYFSfUC72f10vJtvGpag+13Zz/p3cT/QXWQcFaCizLHhG0bOA5m9oF7AmJnd laXeUU5lyNMrailOaGjto1bB4i/dWaGspyiot1OwMyriJSAQxdeZVCcyb26ZSXruoouN CeLz/fPsNBFUFm897PMUHjbYVWPTLCR4mGfdaHm8JLu5sAW6DDBRQuepb6RDu5RUQ5R9 W1Ag== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1776735631; x=1777340431; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=K2zGS7szlnxtf2CAjUVWjJKVS/xd/C/u9KRYIR0r7sg=; b=fR6yJeBUdnOnBS5J/L2/MSOnDvRNsYWHQlbhBFghzOojqHMoa15YKz3sF1VaCvOotJ vy3eeKDH/S2ckQtVVgWpjsP1CTi2fOlbH4ObQiMgkdc1jJ3TvJqO43rufVvnJfO97B7X T7nMg66AqS7XUpNrcS0QCR6lX9KOzAaFTzZZjqpoh8JuyvrwTvalXwGcak6We9agJwBh 5TKbgYeKAVd8sJt8OrUjaVc+msE0Du9Pp80XGqst73eoz8F+yOYJs14/4iIre8eHmgEC On/Qgk9OVzIfZPf4M7iY+EiZ09BQssLF9T0x1UlMxKt94ayBrX+3qLAi24777t+a7/Hp AWsw== X-Forwarded-Encrypted: i=1; AFNElJ8eFpXAPn9+GJzDiWojuoFnMFLVvMW1M0IHvX96JGm8yP7vFYjuvbvodTELNW55AiGbFQxtpKU3BMe51J96@lists.postgresql.org X-Gm-Message-State: AOJu0YyyRCplOKm2H3yXtuSN7LGiyL/lYugw/r8JXLM0LaeITABKNxBh 2JiYNStmBRx6xG1xIcSOVr6iHidThbENCWAfi+0v/8HDVrEqbzLw7BsexK1ESZmINOyKonHPyZT K8kfKQPstTK2JSIcXHI8v2R3v1vMe0bQ= X-Gm-Gg: AeBDiesONsUIqCKEZsVwaJPhLz942gqhxhFkeuWkWpGpvzvel3q3ik0eEqwEFTYEKya RY+7yxHkxAn3t0q2uQ4cZ2WMdSNgb3rIticEppLIj5VHi4K1eSpO3aLd8La42dJr/ALla/0gdAB 0Z8mHy7MnTRJKHTQNj0yVKXR2s/M34K4kWJXbgbZTtko6VApIJRfh7MV15G0BT60SvytbAEnBmf KnZ+4IRoOaJDoaFb1FAChFEJPtEQHrIImqDEo4cuDxkkZ3J2CsTmR2Te+0+rSuL5GWsy2N1diG8 SyiExJadhx2ErrmPAG24guqEiQZCvLgI4HGy76knv6gkiIyTx7hHAbJoRou04Q+HAJ16ldADoMu pcPGFHhE/ X-Received: by 2002:a05:6000:186c:b0:43d:73de:abd2 with SMTP id ffacd0b85a97d-43fe3e0b256mr24351550f8f.26.1776735630548; Mon, 20 Apr 2026 18:40:30 -0700 (PDT) MIME-Version: 1.0 References: <278B9FE3-F349-4494-99C5-483105C1C999@gmail.com> <1900289.1776212948@sss.pgh.pa.us> <1913188.1776220247@sss.pgh.pa.us> <77f5109f-6d39-4cf1-8d0d-f826435d6cb6@app.fastmail.com> <6cb75f47-261b-4476-b8e8-18fa6aad464f@app.fastmail.com> In-Reply-To: <6cb75f47-261b-4476-b8e8-18fa6aad464f@app.fastmail.com> From: David Rowley Date: Tue, 21 Apr 2026 13:40:17 +1200 X-Gm-Features: AQROBzCtH7yCcCGtEXHJ_m1AhZq9CoJkrJQlFmBzH5szY9VDRoR1Ig04J_z-a7k Message-ID: Subject: Re: Add bms_offset_members() function for bitshifting Bitmapsets To: Greg Burd Cc: Tom Lane , Chao Li , PostgreSQL Hackers Content-Type: text/plain; charset="UTF-8" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Tue, 21 Apr 2026 at 02:55, Greg Burd wrote: > Were you planning on writing the optimized non-copy version as well? I don't think it is strictly necessary, more a curiosity. > > bms_offset_members() -> new bms, might repalloc() replaces existing loops you've found > bms_shift_members() -> bms is modified in place and fits your new use case a bit better Not at this stage. The v1 patch did modify the set in-place, so the code is there if we ever need it. I didn't find any need for it in our current code. The selective tuple deforming patch I'm working on could use it, but I doubt it's worth the trouble for 1 caller. It's just for something that happens during create_plan(), so 1 more allocation in that code likely isn't going to be noticed. David