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 1w7YrG-005RdU-1J for pgsql-hackers@arkaria.postgresql.org; Tue, 31 Mar 2026 13:10:14 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1w7YrD-00AGny-1g for pgsql-hackers@arkaria.postgresql.org; Tue, 31 Mar 2026 13:10:11 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) 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 1w7YrD-00AGnp-0V for pgsql-hackers@lists.postgresql.org; Tue, 31 Mar 2026 13:10:11 +0000 Received: from mail-yx1-xb12c.google.com ([2607:f8b0:4864:20::b12c]) by magus.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 1w7YrB-00000002B2q-001M for pgsql-hackers@lists.postgresql.org; Tue, 31 Mar 2026 13:10:11 +0000 Received: by mail-yx1-xb12c.google.com with SMTP id 956f58d0204a3-64fc6b21789so5950427d50.3 for ; Tue, 31 Mar 2026 06:10:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1774962607; cv=none; d=google.com; s=arc-20240605; b=HTT/4qOKlVHkhgrUY18cD2ST369Qs041mqrq1vn95kqmyPh5mhup+DtR2ukJQOLyTn Wvl6aSauhrIw8QJSEZuhb+t0C09LWHYQoLIe/43vfPqQU8yV8IRJLr8HKsF8G1wWfmbZ XVQLcTbGiL14zPVSHjzthQC2/aYYuT5T5FR65RePiyv81UcC48j7YGb4OLtDzR3SWJXN s9d+vtRp0EGqvkBeCdka4lnLjVFTNDwAJ33arCoICHgNQNP+ADBUVFBTDp2YAM1fG3Uh bcbrF8+eFQz1SsYqVJV+zohDi28qfiZAvys62+VAoy38j3gHSvBT6h5CX4W031eGiJ9t ziWQ== 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=8Fq9gXeYvZoVK/qEJi3IO5szaCIF5vOGjLc7ojZUM1M=; fh=VyeE+d/tdTK9Zxquwz/oFWj/6xT6ij645dlX5MKEs0c=; b=dsQCZwxzUqWBWRPAtFxBWibeY4OVp6I7DfToHksTsmK+BGrvxtoBXU4kxqh8q/DhbH sqXh2rA8s5Edae6T8yuTl33t1cx4qEfC6X6+dML6cMg8Yh8bdZAkWXcfys+tVb/c4e0y P/LH1svJiEBQijwg1hwS4yUX0/L+kAMLkFCd0VrwJU605HW/92wKbUyfI5oDfwU1pSEu gREiVRM8p7Zmxf6PhVFVtS1XHNvqRrI0NoxrWcZ4+PeJF24GC1z/G2dDTJAgJQJAJI+0 Zx0q/M1cMbWqdfzIS9ILptMGOGuOy3hiGUIQ7hPjn3jnskE7c+ReEYAeHkRTn8tQLpnI So2Q==; 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=1774962607; x=1775567407; 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=8Fq9gXeYvZoVK/qEJi3IO5szaCIF5vOGjLc7ojZUM1M=; b=tEQ8AR75lyDIVAFX3i9QKTXRCpwDb9ihGS33g8O4dBYRfjqYmi4W1r3vVF7yQZLMWb HGz02Uxvj3FTnFuYIpzWrD3anx8y6Y/oDMkMtdBuC9lTxidMfixp3wpFuYeR/NLx4j/0 BDEnDOoi8eqR56Z8SSfqCIpKSzemjG+/ed2x1OQG+IpIHYIXVCWtYHGhfLDVQ9EHyT8D kjM2ikodLQu4VjkMjr2IlueNgrLeWGKdicVeGnxo3Zjx39lOnR0Y27kfuJhE59Bkv99k 5pWZoYViumbGpbhNQZYEj/jJOa0j/o/JIxIj2bHJbiJ5lSF93nd1LIKRw/ZIhqmzpvxh k3UQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1774962607; x=1775567407; 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=8Fq9gXeYvZoVK/qEJi3IO5szaCIF5vOGjLc7ojZUM1M=; b=hq9ztZY0nNh6h0jEntQOPqYd1Jv1h5CmLGJ69LyE4TkVsGuEzBou6fhyCSL4mqVqB5 NkRF+whJFAJkLjwsfsGJB+37XwPr+7Cj8p5uhlUv4LJI3S/zhGhcTNJPdC0LncZ1w4Cl 0zLYlioA27up8q06nj7WJB6/9KM4WGKd7LgLQVGwYqOlzVrH2gOdmwyiO9a8XSMNCIjn gkzszRL2jXtMvNqO7/rG8uZtoz3SO1UpK8hyubHkg9upqdGXTAU8/H4+K4nwqQvZlcgc DPhM1Zw0nx3HSG7PzmVpH/99rnvh+iZ9tKjF0YSj+cVAXtmvsO9Eb7jFLf94N74Jvxx7 yUfw== X-Forwarded-Encrypted: i=1; AJvYcCUBPfZNpTD/YqZgYrchq21cRG5fIQJWXaKsNn9jSgLNUYUqikatH/CZ9iLPhgGFnpotmIlk48OVCbaEV5cC@lists.postgresql.org X-Gm-Message-State: AOJu0YwZ+1MyVBx0TYajVSTCl/J24F6EHPDbPkahocc6s1n89ixg5amW /luzB/EgoO4hIB4OhF4MvGt+3NFHZHSHU+bCLIbr5A/knWBdprwb12KoSwF6SuQPD/1zQjL7yMx ED+i2khxMj6oiO9/KNozJ49GctlW/NFU= X-Gm-Gg: ATEYQzxbFYF2nuwkRBCYPE6mYQj/u7bRzMA41rB91et283r3E1QY28/c2+h1wpFtJQ8 Urrr1hVM2DewZxMCLMaReNdjgCmU6C5r2oJdIH/WqSsJzu3Eg4/c+uEf7RSbjMFOe6K0dRrl12F +qUDTUyoG2ZCSPr7n1tMIqqrdk+SquibiMdLhX/EhjOBfGQcsV4bDTtoYV09ivWzmiI+RmkXQre l6xHsfWLCxv0FQFXBJdgq6gijbeDKNTkkAzZYVUrWbVtrWGxyXXfsbcLVKwCegdUq4kufGRuRor p1Bi64bV X-Received: by 2002:a05:690e:c43:b0:650:1c44:ccc5 with SMTP id 956f58d0204a3-6501c44d007mr7039808d50.27.1774962607174; Tue, 31 Mar 2026 06:10:07 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Daniil Davydov <3danissimo@gmail.com> Date: Tue, 31 Mar 2026 20:09:56 +0700 X-Gm-Features: AQROBzDKGvJ-l08xypHDVIK7QHXPLSSTbqvMxMMZAdsGOKSRhFFVMmR1ejDuH00 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 6:53=E2=80=AFAM David Rowley = wrote: > > Looking at the other users of message_level_is_interesting(), every > one of them that's passing a const is using one of the DEBUG levels, > in which case the vast majority of the time we will take the > short-circuit path. All of the direct cases you're adding pass LOG. > Indirectly, I see some DEBUG3s being passed via > KnownAssignedXidsDisplay(), so maybe that's worth it. I don't know. OK, I see that you doubt that users will not set their min_messages above t= he "LOG" log level. I asked a few people from my company who are well aware of typical customer settings. They say that log_min_messages is set to WARNING the vast majority of the time (hah, I like the phrase, as you can see). With the client_min_messages parameter the situation is less unambiguous. I= t is usually higher than NOTICE, but if postgres starts behaving "suspiciousl= y", users immediately lower the parameter value (up to DEBUG5). Pretty obvious = use case. Nobody wants to have huge log files, especially if we remember that t= he most common error in the production-level systems is "no space left on devi= ce". > For me, when I see that, I just assume the person wrote > the patch because they can, not because they thought it was a good > idea. Since this place is rife with people using things like static > analysers and AI tools to give them patch ideas... Wow. It sounds pretty unpleasant, but it's your right to write so. Anyway, let's concentrate on the patch. > very much not inspiring to commit any patch that comes with no proof > that it does what it's meant to do, especially one that has a > trade-off that is disadvantageous to people running the standard > logging levels. As I wrote above, the log level is typically high in the production-level systems. Of course, I won't be able to provide evidence because these syste= ms are "secured". If you cannot agree with me here, I'm afraid we won't be abl= e to agree on most of the fixes in my patch. I am looking forward to getting your feedback on this issue. > > If you still think this is a good idea, then you're going to need to > show benchmark results and scripts to prove that the extra overhead of > message_level_is_interesting() is low enough and the advantages of > skipping the extra StringInfo code is good enough to warrant doing > this. Most of the fixes cannot be noticeable in the flamegraphs. If the client us= es only WARNING log level in the production then the usefulness of the patch i= s obvious for me. So, I think that at first we should consolidate on the issu= e above. -- Best regards, Daniil Davydov