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 1vzbEZ-0019Lf-00 for pgsql-hackers@arkaria.postgresql.org; Mon, 09 Mar 2026 14:05:23 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1vzbEX-00GeNY-1C for pgsql-hackers@arkaria.postgresql.org; Mon, 09 Mar 2026 14:05:21 +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 1vzbEX-00GeNP-0H for pgsql-hackers@lists.postgresql.org; Mon, 09 Mar 2026 14:05:21 +0000 Received: from mail-dy1-x1331.google.com ([2607:f8b0:4864:20::1331]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1vzbEV-00000001IFr-2W4V for pgsql-hackers@postgresql.org; Mon, 09 Mar 2026 14:05:20 +0000 Received: by mail-dy1-x1331.google.com with SMTP id 5a478bee46e88-2bdd40d3c61so9918234eec.1 for ; Mon, 09 Mar 2026 07:05:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1773065119; cv=none; d=google.com; s=arc-20240605; b=BVirTBvDwMc4lTvcc4g61x+aoRc+2FV0bqemCrsJuY/xNTEpbpEFVcNPi7VG3oIo17 wmOUGjvuz7Wz7Vhi0pxVqvAJ1aMJ2ct4GIOy+IzCTQLNtgwyf93k69waZoyWcKN54W4c I1h8VzesWxDTcxWYg2hF6DfZoryQu8hs8frlA3EW8dNkYMWEnoDLbp32YZJcLIb9tM/h O4Tw+Ia5aVF5ztrZh01Qfvxb09rY0rOhLlDH24/7+SXeSpiGX3L0SXBi/EfdiWDHhXag 0/NWjII1QiqZ62qUHyXfQ9ERJHGizp+euRvnBJdu2hNjPiX2O2KBBYGY71LAwFkZqnnp cbPw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=88BpaZ6aoPhnkb4CjeauzQr1PIoB6PLGH2amfb060sU=; fh=fehX+dSXHrIgCc3h4InFuGDgPvwzJKFBTFHKY5o6R7c=; b=ThI/4swkuavd22ViCdPCEGzF06fS4f2UfHftYn9U4z0d8iaeUW/eJsVQEHdbR0eiIE HL2ndxiNfKX0sDs0B8CLXxmdIgA4fRKNiMP4nUWI7IPu9i7wbdSSFjIH/mZVGH+a6YI0 6eOF9hxSSp7uoHYJ3QoDhW4IcNETeOU6VKSDIXbBdOol1U/AGU/jM0y6EUUdKLzAzSUB B+Ivo27OUGrWMApiB8o7NBTkwDDZ85Wth9yDqY7oJ53Zu/cRsC1cHnogbOwc1CkXb7/R 7ddH+HraLo+zF6gAGa9eJG7WPeqbLUXV5mPJqWWPfOgQLQxnWJPiEGsVqxKcR3a8hhzk sjNQ==; darn=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=20230601; t=1773065119; x=1773669919; darn=postgresql.org; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :from:to:cc:subject:date:message-id:reply-to; bh=88BpaZ6aoPhnkb4CjeauzQr1PIoB6PLGH2amfb060sU=; b=hNOR9KJMgYm1r5QBKIKad2nSGqiMvi0u35HjrSpwVgMOGpcOQNlWXBAGw7C0dYx13r /WW2CuocACMgMuKjQukim8mas9ZsEVJI5GrdD0kJOgh7S5b3FvNmCQOnZjPBgEhaoBFE TIduNgf6Ws6QKDKfZTcGz2ru6PZtu8Ckxd62HwQ6/z9JM3xEKl7yFAdf0hBB69gCcyAA t85uBImPNiJ+TjCVGyV0PQTXjpH01q05gwmveIBWE7E4RJKNbopqcKX/VL88zQK8wIBt rWZsLN8Yy1S3d9lwn1jzm8+1oxWKxDCDteUxSZ9m7kjqE5FxB35prWXqF1zdgtiFVuYM emQg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1773065119; x=1773669919; h=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=88BpaZ6aoPhnkb4CjeauzQr1PIoB6PLGH2amfb060sU=; b=kGuYBRlcM5c333/TvM5q3qsCFPW6M8kKBpOly2AKqIAT1FJV4pjJe+r01/WebPefOE RyVTFD1O7jMUezMvDpGs6VLRWT4AIeDfXmnHLmKQbJ/YzaAOoQ3pQckI2Bi6Y2gYrDbd BLl2tBpuoANQ7REip52/ZMdCXFuFKJ6tH7I/uz6dY0ClPP9PgFQikDa9LBWMQ2V2sHA5 L+ssWFl1G9HkqHSHQQDqeNUqqpYRotwC6nWF/n3t9QEdNjLJx7TQu0jZjlaxgdoUa0p8 pivpIy4MQZt3RD0s2nglIpEseYs88olscYViPEWG8dgkHZl9FEGl2gcl0FsxXaX2tM3Z 1nWA== X-Gm-Message-State: AOJu0YyeU6Akcs4cpzNVIP/sWnV2uYggLHrJUQhU+miItD6s0FDKl6wc cxTk8BDuNwFsnb16b9biesHRt+RmulkXNMJhB21wUGDSPCLOuPEarKztv6mfXGFgb2S+jGfucdZ DQ34NRhRsdgS+CzIDbOkxodhAlZYyLiAxAsyx X-Gm-Gg: ATEYQzxJrAJ2Wu/sG6W3bufyJAR7D53cc1g+MYnhPjoDQ9RuC/ljGLSEtu/OslE1m/x EYVjuHzMJnyBN7C1RYcNYfEexLub6vCgTs39kj1T2SjdRAlCKGnds1e5CUNSRsducpHMbcHFt7v VfRyh7k8vt5jN/wsEK53MPfF7P9nbkggAkLdRvWd/IHclc9VP2L8Igkx97o8bTuUSGcKsbRaNxE uGYeckOTV2wclHZ6hOhmI0XroqKDI2B4ZzIHDQRKT3FGhbs6Nqa1HykYbCSJ3hEWUadjdgfFgIk khqM36Y= X-Received: by 2002:a05:7300:ed01:b0:2bd:c872:415e with SMTP id 5a478bee46e88-2be4e0a0fb8mr3878254eec.37.1773065118412; Mon, 09 Mar 2026 07:05:18 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Ranier Vilela Date: Mon, 9 Mar 2026 11:05:09 -0300 X-Gm-Features: AaiRm53muQ77F68K5BYL4cjJnWrV5BnNvse2K0328GZz3tQB5oN5d30_2Jm6dv4 Message-ID: Subject: Re: Avoid multiple calls to memcpy (src/backend/access/index/genam.c) To: Pg Hackers Content-Type: multipart/alternative; boundary="0000000000008bf3f2064c97e429" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --0000000000008bf3f2064c97e429 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Em seg., 9 de mar. de 2026 =C3=A0s 10:16, Ranier Vilela escreveu: > Hi. > > In the functions *systable_beginscan* and *systable_beginscan_ordered*, > is possible a small optimization. > The array *idxkey* can be constructed in one go with a single call to > mempcy. > The excess might not make much of a difference, but I think it's worth th= e > effort. > > patch attached. > Someone asked me if O2 does not do the work. Apparently not. https://godbolt.org/z/h5dndz33x best regards, Ranier Vilela --0000000000008bf3f2064c97e429 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

Em seg., 9 de mar. de 2026 =C3=A0s 10:16, = Ranier Vilela <ranier.vf@gmail.co= m> escreveu:
Hi.

In the functions *sy= stable_beginscan* and *systable_beginscan_ordered*,
is possible a= small optimization.
The array *idxkey* can be constructed in one= go with a single call to mempcy.
The excess might not make much = of a difference, but I think it's worth the effort.

patch attached.
Someone asked me if O2 d= oes not do the work.
Apparently not.


--0000000000008bf3f2064c97e429--