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 1w7aQ4-005TJ8-2v for pgsql-hackers@arkaria.postgresql.org; Tue, 31 Mar 2026 14:50:17 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1w7aQ3-00AoYn-1c for pgsql-hackers@arkaria.postgresql.org; Tue, 31 Mar 2026 14:50:15 +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 <3danissimo@gmail.com>) id 1w7aQ3-00AoYf-0l for pgsql-hackers@lists.postgresql.org; Tue, 31 Mar 2026 14:50:15 +0000 Received: from mail-yx1-xb132.google.com ([2607:f8b0:4864:20::b132]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from <3danissimo@gmail.com>) id 1w7aQ1-00000001z2S-3W7V for pgsql-hackers@lists.postgresql.org; Tue, 31 Mar 2026 14:50:14 +0000 Received: by mail-yx1-xb132.google.com with SMTP id 956f58d0204a3-65005a8840dso6502737d50.0 for ; Tue, 31 Mar 2026 07:50:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1774968613; cv=none; d=google.com; s=arc-20240605; b=DtwndxrNv56ejwhHUk8wBChK6vHN6tpUFSPMcjhZAX1F49Eq105r/0H7MhMQbqcSfG GMUO9gXx9TxOiScHO5YC+Li5zlH6uS0FO8QJ/gFVMxffZbbZZSOBc5Zi/RGjzwFaAxHH UIkVH7v5pk9wezRnhYynbu2qXVjYrjhx+cSVK5wexNUHXe3/E9+5pzp8QdZIRdII+/Ww lX1QWkixcJRz8iaRelF4c5SwZkY2Gj5f8WyNJA1RTesCGDUX7xCgocTPrwYCLscZ0OGx MXbwdzEetHdGJXUVRMt3REv7hQNj7cjw5kI6FywXn5Xde6E4AiY6EhT2hMOksuaYBNm2 BmvQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=OXh6oqZMeJb86TGpEl4+2vxKaC1IokV1FQ9uDJsa3KY=; fh=PJ5KM/u5fEn6Z05yGb/w4k22oDvlPN0+l7xQizO1M0E=; b=C+EQj2szg2h9dd1JNzNIPH9I3yi8/6z6x0orVj5vTmXhLsqRk2oOl8Bm3XshynsGE6 BB1tZK986Ukn7/2YvfPfz0nNI0PuQgijOipetgNy9GoaL0UX85jpDg0hCRYltBi8qO5o Mh/Ft3NePvqaiHnlAvo0/NZAmBqlRcqbsSSxTAdwmfTL+FeiG5IboZ9r6pv88tIvhn0V BfUZtA3fNgWJtMcBLC/ZFsOs5Ob4vN9dFJ6ExFObK2gnnPrHHmUqTBj39wi74Dyv1oxb Adpzn2vhP+T5T8xuLU1GqX8Lq8Ict9meC5cpAKQ0+Nt7lFqR38d7ESKcPcxpcW7Ey6Lx +feA==; 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=1774968613; x=1775573413; darn=lists.postgresql.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=OXh6oqZMeJb86TGpEl4+2vxKaC1IokV1FQ9uDJsa3KY=; b=XqKx98v+bDopelM+avZPmW/cVkE/ZRburZsCeV5QAD+jyVZxbBbIBjBKgcdVy6CBvQ oje3diPmVTNTx1JMWsaKFkaUZpSTy35T3opH80yKCYedTSRnpl4kXlg3avCsGMfU/5zW uhSsnukSLI1nFGxse8fjNwQERDrhSP/pi5r0Pg7K9/XY8/XPvELJt8xi8M6Ee8ZzwGi5 aF93eNVmZ08p1gmXbOJvRB1Bxrv/LtezmHHLEGLh0vbd11Eb3Xd+OQHYtKdeMIcUy6ko 6hsidEGlbyEndoS8HVyzqy5Ft9M4bCI+1oo5w50tHQMnGXsJ+1vIvZtt9XUNNBF1c0A6 PFaA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1774968613; x=1775573413; h=content-transfer-encoding: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=OXh6oqZMeJb86TGpEl4+2vxKaC1IokV1FQ9uDJsa3KY=; b=Hu9fQzYblmd9fjyvSu/NIO/6wA8n+1PrsXh24a/mw1nVFNOxsOFpXCw9Mcv1FW+9oL u9UMXsi4fqIbKnTYw7vEyze+AnYDsGgz7uuN/FTGXX60xwmsD0z6A2HXpQUXhTnXYji3 t2NgF6FdbOy4tb7fKupcq+LxPSuSh+glLbVt/6V0j0o9Tt/Ao5SOYdUvka9No0uw+2Te m//O+7ctiERS9SN7jKaIKMEgQMRPbArPIM3d5sb77AzZrKDfBqHHP2vRTFvkgnq2XlKJ XdHlgjddD5t7F6/axxH8Mu/hw9pkOx5FMweSFeSb4hUN90+Lop+D1jzCRAh0Ywad/HsU MzHQ== X-Forwarded-Encrypted: i=1; AJvYcCUWmbM+3pOweKbQ2HpiZjlXm4SVY9Ulc+07YG8TLx/up/upqsr2EZoPKVY+CDS49hoIB9x4mMk0jWmxZXRT@lists.postgresql.org X-Gm-Message-State: AOJu0Yw2dzvx9/BDJLmaCtYZ+b88UKcO3QBe95TQ74tmT+JfCvsiUOUL 7Stt8mcnD07/aSmx4UxGBVsG7UZOgD04ygovUmWOnE9zG6NCwi9bQKWfAvA44PiEZukvcSDIYlJ uSw5Oev6NUBArqnV/dRSY8hsuAhODEifCNgS5 X-Gm-Gg: ATEYQzwIhy32QzijByQaP7qUSIm4Xx1sTiT48fCgmiQRBmWN+fehufMIuXApvLUDr/b Ev6m0/tcjV3wmva3pj0frpRgaTBV8Cxb//Ah+5DFx1Im3a6VTFpuO58ofpjM/Kn6x/nzHE/XN8C eC/BhsIBEIKCAu8UDtP8Ud632j7Ca2VeyFQ+RcnTemjf38JYOycppM8fr8KQCzRKrA6L0m+ZhUg BDz6kVSVRD0GjRT5CSqY2WiQMbzFEm3WLAYTw8fM1CPq48LG4OavaFSPwXkiBFyGuscBJpgv7Bi Bif8m28H X-Received: by 2002:a05:690c:34c9:b0:79e:edff:4e97 with SMTP id 00721157ae682-79eedff52e9mr75364317b3.9.1774968612760; Tue, 31 Mar 2026 07:50:12 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Daniil Davydov <3danissimo@gmail.com> Date: Tue, 31 Mar 2026 21:49:59 +0700 X-Gm-Features: AQROBzCxUqfoIHzThlweiwfZn47I61yU_Ihql_K4OTq0XqGH08PmM2R4PmvB6ns Message-ID: Subject: Re: Get rid of redundant StringInfo accumulation To: David Rowley Cc: Andres Freund , Postgres hackers Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hi, On Tue, Mar 31, 2026 at 9:07=E2=80=AFPM David Rowley = wrote: > > Do you mean that the new message_level_is_interesting() call isn't > noticeable? Or that the extra work to build the StringInfo can't be > noticed in an unpatched version? I think that both message_level_is_interesting call and StringInfo building are taking negligibly little time compared to the time of the entire reques= t. Of course I can create some synthetic test : huge loop with (for example) KnownAssignedXidsDisplay call. This test IIUC will show that my patch makes things better. But I guess this is not what you expect from me. > If it's the latter, then what's the point? TBH, I didn't notice that message_level_is_interesting is not considered fo= r the LOG level.. Anyway, I am still thinking about code consistency and poss= ibly noticeable changes related to lwlocks (see below). > Your opening email seems to indicate that you noticed the issue from > looking at the code. So, it appears that you didn't do this because > you noticed that there was an actual measurable overhead and you saw a > way to fix it. If that's the case then perhaps you've just assumed > this will make a meaningful difference. If I've misunderstood that, > please correct me and show us your test cases and the performance > results. You're precisely right. I noticed this issue from looking at the code (whil= e working on some other feature). So I do not have any benchmarks, which I th= ink can be created only for the changes in lock.c and proc.c (since there is a lock acquired there). I will try to create such a benchmark. I hope it won'= t be as synthetic as I imagine it now. Please note, that I don't have any information about the typical log_lock_failures/log_lock_waits parameters configuration in a production. -- Best regards, Daniil Davydov