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 1w5MNI-003AeL-2w for pgsql-hackers@arkaria.postgresql.org; Wed, 25 Mar 2026 11:26:13 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1w5MNH-00Dq5m-0T for pgsql-hackers@arkaria.postgresql.org; Wed, 25 Mar 2026 11:26:11 +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 1w5MNG-00Dq5d-1v for pgsql-hackers@lists.postgresql.org; Wed, 25 Mar 2026 11:26:11 +0000 Received: from mail-dy1-x1341.google.com ([2607:f8b0:4864:20::1341]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1w5MNE-00000000xQ9-2EDr for pgsql-hackers@postgresql.org; Wed, 25 Mar 2026 11:26:10 +0000 Received: by mail-dy1-x1341.google.com with SMTP id 5a478bee46e88-2c0bb213b16so11532031eec.0 for ; Wed, 25 Mar 2026 04:26:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1774437967; cv=none; d=google.com; s=arc-20240605; b=VR1dXH/VSwgXCo1uElRGH+tgTf9nJ5fJe7zxp1Dflwi7wQGDjuz/4XhpD8yZ+LEpzj TA0ery5osYzK+upNyTUD+aBTnyzcfXhIIQNe270CvTzjLj6Tvhc9scYPhQcNwoU6DF0d r6HS68ckW5ZMHVqNFtXsG3nPDya+H3Bp74dbbivYHltuhP/liQCiaZHd05gjXGZ4orjB Mw+qSK1vYc8e9c3oHi9O32LUqNn80FAK0F4xGogH0MzC4qOrUT5ZU1ygN7rC7lK0Pujd Icz+qpOVRmaQ6rxIBQF49xNYxNxs72887OJxxQIVFlcAZXzv0yZK8JRSMNbLTaQWbgtN 7vWg== 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=DkLrZYFjJjsBZ7FDndJ4HhgkyEnFcGItpTpI7it5n0A=; fh=O2MapRx9lhuoOZ29VRnQ+GgUp0DyynyfWlvswMC6hmc=; b=Tpx7gDkfwRiOsOLV48Ke3x+Sr2dt/txSRpn2hx3IbUwg39NRVpZM8NYgA2uMd1HqzP g/W/XeQ9msXnCHdaE6ZoXxNhDpvPEWz3114GAlGUYvGg+jmqgxVIzuNM2QNwQERVShJW Ofz313gvAEvxpDAtAIVE7xz+9g1F4NL22eSoVHyru4cobtEtkiQXzhBkgbOthtgr+F9L ZpcWnGgkKWj0HBmRCYhpReE56WBFn1x6SrxEhtCzjLU6cQeJEuTl2tLisX+DBLs0SXwI JEBoEPIpU/DOrBTgTHfTBN6kL8rgnwGnyLUhI21ebGBtq67So2OlVMiDVNRLhzzz04Iv qdbw==; 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=20251104; t=1774437967; x=1775042767; darn=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=DkLrZYFjJjsBZ7FDndJ4HhgkyEnFcGItpTpI7it5n0A=; b=dLpbIH3r1W88gemWhI4jyM1ZbSRpyXxwmH1MCWQyqKRRUMSQ4Pn6iuHUZCUkxQU8Hw unsxdFlHQN14P50thCl56sh8aB+IkdI9w/QNPWy9TxB4j+Um/2d/MEOXWwebpCuJEOlk f30Z92UyvsbTdg3dPKZsq6nqM9OgHzqy5H25N5KkWFOC2in0iGyOlUoyBbw/256NGVeQ 6GgGhl9VJ8mTPSHQXsmbE892FahF9wybWD/FYOgzKJ7RLxq1omLrg6MM/dHKem1PQGjk vaoPqpdtwPrM2AcFYNSvdPNvLlz2wVvnKcQG1NZ7vFFT3WFaE1a3YDbsP0kouuVyqWSu PyuQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1774437967; x=1775042767; 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=DkLrZYFjJjsBZ7FDndJ4HhgkyEnFcGItpTpI7it5n0A=; b=f1LcEmMmVBNdFX3UEA0MUKFnHqIamDgDCtKwgDobZe42eto6cYPvhOz5+TO7VFZ6V6 C28ZVEmqNdWkTaLrk6e7Z5hWShWNLxGZ9VMx9Pyysl3nisfzrz9exLoOt5Fq553W5W4l SDeB0LR8RQ9THCJqItkR9GybfkpNzS8Kn99TZix99W/d3VPAYlHcjVscTGnx+HZA8zPW 4x0h8mahlDI7uFjSvJJ9wBmpOa7usNlV4GrLUBiR/uKAphe8GIkyPdzyysCbQhGuY7y1 jbTDGxM33nq47ZzJdovOG8197gRVY05Keq4U4YZ0sVHXMJIfKqpIWl0hseGQKiJC/gce QSEA== X-Forwarded-Encrypted: i=1; AJvYcCUwzF7NXNU2bi4vNq+eJzC3Dtrl8TUxDlvlADaZqU7qxZ75nLjFo5X6TKUlYTrkBY+X3ofvI2LIIRR7uBmY@postgresql.org X-Gm-Message-State: AOJu0YwR2wZlVH1KvG21jpSKTPuFkPLoHBe17H3ixIdsHySfFoaLKlM6 jZrFC1jHOIyrjvJmdqQmJ/xaLuwiTZzpxmhaltA2KKSq1Pybmhg2DpiaXs74V2Mdmt2ub4sIgmC OjzOpVB5b5R1wABvO40xzlGBEoLmfjUA= X-Gm-Gg: ATEYQzyHb9CKjVMzg/mXzCMiuEQpQeUVuf8KO0iIRZPsSt0nT+GTaHrDNO27kqjEOzV xYmJE+SiHomUnUoNqki7Fc38lrmuSxOGUI1NR6WVBseuZbkPxaTEg87Y/l5mRdC+kR8qkTYSCp2 nqNQ4M+8U03aPY8n/TKVXiGiZ/W/Ewsj7Jt29Gu02QH6BleJKBav2IWhC4UBlJWhQL5+oRv+rC3 1PEmaKkWEJk4uRrQ2f4l3yUmdBYISEMYN6Ek9dBVybQwpN5+FXwTThoakdhFjEvKQmKkD1skGwh awYR5d0= X-Received: by 2002:a05:693c:3743:b0:2be:ca4:e13d with SMTP id 5a478bee46e88-2c15d3fbcfemr1679447eec.30.1774437967052; Wed, 25 Mar 2026 04:26:07 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: lakshmi Date: Wed, 25 Mar 2026 16:59:35 +0530 X-Gm-Features: AQROBzBkJlWMnournmXkRr67-IWlgV0b9Q6dvNC1qbw8iGNKMeE8GRHawa02rE0 Message-ID: Subject: Re: Avoid multiple calls to memcpy (src/backend/access/index/genam.c) To: Ranier Vilela Cc: Bryan Green , Pg Hackers Content-Type: multipart/alternative; boundary="000000000000b3c43a064dd788ab" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --000000000000b3c43a064dd788ab Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable > Hi, >> >> Thanks for the suggestion and for the earlier discussion. >> > Could you repeat the tests without enable-debug? > I repeated the tests using a non-debug (optimized) build of PostgreSQL (19devel), built without --enable-debug. Test setup: - Debian Linux (x86_64) - gcc 12.2.0 - AMD Ryzen 5 7535U (6 cores / 12 threads) - pgbench scale factor 1 - command: pgbench -p 55432 -d postgres -c 10 -j 4 -T 60 I ran multiple iterations for both the original and patched versions and considered the stable runs (excluding those affected by checkpoints). Results: Original: TPS: ~1047 Latency: ~9.5 ms Patched: TPS: ~1040 Latency: ~9.6 ms From these runs, the results are quite close, and I didn=E2=80=99t obser= ve a consistent performance improvement with the patch under this workload. T= he differences appear to be within normal run-to-run variation. It may be that this change has limited impact in typical cases where the number of keys is small. It would be interesting to see how it behaves w= ith workloads involving larger numbers of keys or different access patterns. Please let me know if you=E2=80=99d like me to try any additional scenar= ios. Regards, Lakshmi --000000000000b3c43a064dd788ab Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

Hi,

Thanks for the suggestion and for the = earlier discussion.

Could you repe= at the tests without enable-debug?
I repeated the tests using a non-debug (optimized) build of PostgreSQ= L (19devel), built without --enable-debug.=C2= =A0

Test setup:

    Debian Linux (x86_64)

  • gcc 12.2.0

  • AMD Ryzen 5 7535U (6 cores / 12 threads)<= /p>

  • pgbench scale factor 1

  • co= mmand: pgbench -p 55432 -d postgres -c 10 -j 4 -T 60 I ran multiple iterations for both = the original and patched versions and considered the stable runs (excluding= those affected by checkpoints).

    Results:

    Original:
    TPS: ~1047Latency: ~9.5 ms

    Patche= d:
    TPS: ~1040
    Latency: ~9.6 ms

    From these runs, the results are quite close, and I didn=E2= =80=99t observe a consistent performance improvement with the patch under t= his workload. The differences appear to be within normal run-to-run variati= on.

    It may be that this change has limited impact in typical c= ases where the number of keys is small. It would be interesting to see how = it behaves with workloads involving larger numbers of keys or different acc= ess patterns.

    Please let me know if you=E2=80=99d like me to t= ry any additional scenarios.

    Regards,
    Laksh= mi



--000000000000b3c43a064dd788ab--