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 1w7MQn-005DkJ-0j for pgsql-hackers@arkaria.postgresql.org; Mon, 30 Mar 2026 23:54:05 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1w7MQl-007DKp-2S for pgsql-hackers@arkaria.postgresql.org; Mon, 30 Mar 2026 23:54:04 +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 ) id 1w7MQl-007DKh-1R for pgsql-hackers@lists.postgresql.org; Mon, 30 Mar 2026 23:54:03 +0000 Received: from mail-wm1-x331.google.com ([2a00:1450:4864:20::331]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1w7MQj-0000000255O-0www for pgsql-hackers@lists.postgresql.org; Mon, 30 Mar 2026 23:54:03 +0000 Received: by mail-wm1-x331.google.com with SMTP id 5b1f17b1804b1-486fb14227cso66552815e9.3 for ; Mon, 30 Mar 2026 16:54:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1774914835; cv=none; d=google.com; s=arc-20240605; b=ls6tvTHt8t6dgk56xB32Sojq0ZpPWvr4ccv2ZB6VwOsVcJfyiMVTEWEuPfBr3qnkxc KRXYOkGMiJjz7woTsoNIQmYDLDYXEoh6POrUS1RYrXMakhbrKFJZOwpsPcHYcJps5pXG QWvjka+vLD9rIC7uhLyoPfZ6f49uz9BpRr1z2tNOjP2gAuH1Zak6S82VAPFbBKfCnSRn qo+SJw4OL7TBWg//17WMy17OsarsoA8dEPOKlwnzAq0IBabzbmv8G56GLl3YIOELW+Z8 vtC7lTkDIP3GE4JYDXZIjOHDX7SiSmmJFqELXNvgWfyVQ3KZ5Fpjro31WlW1yRYkVhAM lJvQ== 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=bt7yrvwLV9LQqYuWyC5H1yoNDNrfCBujs/zLbUl3yzQ=; fh=502nXLBYiIIQgoE7vE6dUW370ORKOxI9wKoJ3kdteMw=; b=j/xXHrzE1DXb6za9UMJePQkJ+QyhzzzMyCsw/Xq3+rmdMMp/2AhBPWkzNYZea1VtwE rc33gHkOQZwNvzgPbA6jDq0xXWBdYIGBWu6N8aYnsLVOVPdIe8Z/hRpda7J+3YY6i1Xa MqdmZmeBptj85bQWOw4O8xFr8IjkUMAoumDRkUDrOfeQnHVzncCGnpzIT8VHV8G5KyiN 4yzGYpjFi5KZW41nT1RduDqyd96FU4tY3crq2+gbEO/oQPDQAnyORmNqaJJjLNhYLw2e ZpJBixsRj5tYCH7j/r9rOo2xhOyByh+6zKzBSnwoERvJG+nDECU/iJzwFmuqtwVvvnW0 us4w==; 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=1774914835; x=1775519635; 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=bt7yrvwLV9LQqYuWyC5H1yoNDNrfCBujs/zLbUl3yzQ=; b=K/KGzNPzU34ld9PXmIx2HbA5vVu7AhISmVnl/7MgJpcmOdMCqLlRWsTUx7UTmaySrd 6xFq+VVIs/tBEgwFMyJ/5tM44EIBXmCLpW5WbGFZOiSWI67wvFntPIqWWiGfUIc9L0gh KhGEpEmK72r9xT+mo8vS835rgWMjhQQx5gwUYg8cMz/ZEEqKHnD7BKTgsZtHXsjoKR3e mvv8KAQYUpVQ99x9hlkzlfLYA7MdOHrWNZEdciBp4KJeOFL/SFmsY3DY9150fSei6/hG CXvzXoIQu0eKlCoO0neIx2RvQ6I0IskIon4DWMz2ogzS3ENmwab6v2RjFfcbD10pVhUe laqQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1774914835; x=1775519635; 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=bt7yrvwLV9LQqYuWyC5H1yoNDNrfCBujs/zLbUl3yzQ=; b=AKKC6nVV+mHGVEUrw/OxVZHPrNXs8JRaTwp0OFnTy7vv1g3A4UD+pajyjbw5Ds9uNo D4s+/iSnRk9n9StP2QopoVoEwmwxFYYZuKcW+OC9O3TRVbi/v7+99IWsbQdci71qNef7 PYnMtfqywhHcWWLKkXrtMPLRH9yWD29Kecg8TeLvwTTyOnOueHcAotJydACPhgmlP5e6 pP8tZuDeoQ5dL6ATLSUOT9nahNXht2/kDACTgDEIkfbO6aa9MKdZ6S+z9EERQJdC/M9R poUyPp+7hOhebV/R5blxOTDgFnQYHse5vxXgwURwzxLZHgQbHp85BOxKZw2367gyfmHS yulg== X-Forwarded-Encrypted: i=1; AJvYcCUhYLtOTC7FGTF9pJ62QhsxeuXnyraDr9PCp9KaM/8ASK7h645gB+DXVrGAH7dOzRzVPawhAuRmsVow1PlU@lists.postgresql.org X-Gm-Message-State: AOJu0YzRAK2sv3ZFi9vn97k9XlDlcKZ03QRt+pxJXI7pwGryW2ZftT9t iok72id3qv5UOeA9XRn/KG43jScMJFBicxWKR/DKGqmCtxwcx8Rj9GzsshCU03NPazWiT+c+Uw+ 41tHEIWyD39yW65z0d89qeHhgiZo16wg= X-Gm-Gg: ATEYQzwNL/Dh49R0f92pUsTHrb7bEszbubQHKpfMbSoIm8ihcjYn5yezWzft+VgUsbN 2AZjVxUwzV8wqDTetgt1d4SvrIweMXbnXh9ZgH1RVfA4THUPjOgT3SQUpxJAOGloOu3lyMz+Geg QFPZfms4p5ZisUHoTtqJaRBw6yG0htsQ5wByFqXJ2W9GrIkLawGZR6puQYLtHu9W97LsdIjp09K /fIFDITB+XRh2aFUupOfLFPA/07NhXHcVMnTWL3Fmhs0jInkxPpfCBFEiIKgrdYIEosWjTPUU8E DCC4uOq2KiVj+5vt1nam51LaP1kYDG+YFQ7eGo6/+zpRGeKEg6p8ixeIXJBiOTdQ7MRTumSR10H wm/j1b4Vx X-Received: by 2002:a05:6000:200c:b0:439:b4dc:1e1e with SMTP id ffacd0b85a97d-43b9ea4a1f1mr22686571f8f.29.1774914835247; Mon, 30 Mar 2026 16:53:55 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: David Rowley Date: Tue, 31 Mar 2026 12:53:43 +1300 X-Gm-Features: AQROBzARYigM8_dAUs73om8Z7u1lVN2119WYHgcWbLlGE--YpXnbSLdB51M4xZ4 Message-ID: Subject: Re: Get rid of redundant StringInfo accumulation To: Daniil Davydov <3danissimo@gmail.com> Cc: Andres Freund , Postgres 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, 31 Mar 2026 at 03:24, Daniil Davydov <3danissimo@gmail.com> wrote: > Am I missing something? I have an opinion here too. It's similar to Andres', and I expect you won't like it: 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. You've offered us nothing in terms of performance results from patched vs unpatched. 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, and since those tools have about zero context as to if the patch is a good idea or not, it's 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. 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. If you don't think that's worth your time, then why do you think it's worth someone else's? It's your patch. David