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.94.2) (envelope-from ) id 1rXfOU-00BvNs-4W for pgsql-hackers@arkaria.postgresql.org; Wed, 07 Feb 2024 10:43:06 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1rXfOS-00A53y-SL for pgsql-hackers@arkaria.postgresql.org; Wed, 07 Feb 2024 10:43: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.94.2) (envelope-from ) id 1rXfLY-00A2JW-1C for pgsql-hackers@lists.postgresql.org; Wed, 07 Feb 2024 10:40:04 +0000 Received: from mail-vs1-xe31.google.com ([2607:f8b0:4864:20::e31]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1rXfLV-005vkz-Da for pgsql-hackers@lists.postgresql.org; Wed, 07 Feb 2024 10:40:03 +0000 Received: by mail-vs1-xe31.google.com with SMTP id ada2fe7eead31-46d2c1077easo123692137.1 for ; Wed, 07 Feb 2024 02:40:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1707302399; x=1707907199; 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=iNPznvm0ZkNsoHR0YopnUN5j7mmLEyq01OU9vX44lXY=; b=SjaaeS1RCTfKNU48gRWs6x52sDpLmo2NYtxLUw/dhFA4306HRer+IgFwRZzsxx6wiD bJm+lBUTnFYuMM3QKDgIcrKNRYeKEK61tISyv1yPVo64/ZgzmeG3GHV/vEyfT+Dn2ulU jgKj8BhiYTpifA2AWt2e7UZN1Shk7Sn5lSNddJSXMLvQ+9qX2iExJ9R02EN2SXR3klRD wFzceAKPNe57lkjtAjjxWZAzBEucwDik+wyH1UhWiQ9v/hVG8gvouTq3DVT3AJ7J8SgU y3HawXt1KTUcCdfHVxf7DefKCtgnMOkZ1ppUYPqlfp99euoAy6kbPi8eXuNofZoYvwft 34kQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707302399; x=1707907199; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=iNPznvm0ZkNsoHR0YopnUN5j7mmLEyq01OU9vX44lXY=; b=NagEg0iIRH8Pziw/iXvnCHUPpVfSVlcH5cTgD6QJtmVay1t/aZk8xe4sfzVLlDzYDG cKrVVAlcQn8oW0SkLtRk6z4/O6Wz92r+nP9BaM87D14xdg/Iv1IZurD9JnRyuqtk7L1o YzvBRZuZmm/mmTsMo4+zr/KeFxsA6JZ5C5oFEbwchZPc80whtv6ClUS9cVXbJdBUK9ZJ 180PpwfrmOjcpF5VoG3ME9s0Buke4pRjXBncq53hXK1K/e7hKrhJEOYjzFd5//dcdhjh DAdS4bJVQq5tlvSUJFuB1/Git2wsF3wj++VGkwPvFT4VXqqZdVK9vVMXq8iDvW4JyC5n 13WA== X-Gm-Message-State: AOJu0Yxvaeksor2bW8Z8PzAvO2hH0GG14XtpZyvYHWR64aZGPo8X+nb5 urXW5GkzDRySSQIqzoRyghmzI010/edrNQmHn88FDdf8r5JVejznzX9ICfdhVGFAm0K7UHmuYnZ +YYQ0as/1y84IHONf9Q82uumwSkA= X-Google-Smtp-Source: AGHT+IFZxT69La6fRKC9CLBucAG+bgvt1x9cdxLJ1Pe65eo2fHoGNs2q3Zm5TwwUNWkz6uwI1vvqIuh0hiy+XmyXvb8= X-Received: by 2002:a67:f054:0:b0:46d:2443:6ea9 with SMTP id q20-20020a67f054000000b0046d24436ea9mr2123089vsm.7.1707302399164; Wed, 07 Feb 2024 02:39:59 -0800 (PST) MIME-Version: 1.0 References: <202402071013.x6psffds5qpu@alvherre.pgsql> In-Reply-To: <202402071013.x6psffds5qpu@alvherre.pgsql> From: Ashutosh Bapat Date: Wed, 7 Feb 2024 16:09:47 +0530 Message-ID: Subject: Re: pgsql: Add EXPLAIN (MEMORY) to report planner memory consumption To: Alvaro Herrera Cc: Justin Pryzby , pgsql-hackers@lists.postgresql.org, David Rowley 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 On Wed, Feb 7, 2024 at 3:43=E2=80=AFPM Alvaro Herrera wrote: > > Many thanks, Justin, for the post-commit review. > > On 2024-Feb-06, Ashutosh Bapat wrote: > > > On Tue, Feb 6, 2024 at 3:51=E2=80=AFAM Justin Pryzby wrote: > > > > > > Up to now, the explain " " (two space) format is not mixed with "=3D= ". > > > > > > And, other places which show "Memory" do not use "=3D". David will > > > remember prior discussions. > > > https://www.postgresql.org/message-id/20200402054120.GC14618@telsasof= t.com > > > https://www.postgresql.org/message-id/20200407042521.GH2228@telsasoft= .com > > > > > > "Memory: used=3D%lld= bytes allocated=3D%lld bytes", > > > vs > > > "Buckets: %d (origin= ally %d) Batches: %d (originally %d) Memory Usage: %ldkB\n", > > > > I have used =3D to be consistent with Buffers usage in the same Plannin= g section. > > > > Are you suggesting that > > "Memory: used=3D%lld bytes allocated=3D%lld bytes", > > should be used instead of > > "Memory: used=3D%lld bytes allocated=3D%lld bytes", > > Please notice the single vs double space. > > I think using a single space here would be confusing. It's not a > problem for show_wal_usage because that one doesn't print units. > I don't know it was you (Ashutosh) or I that put the double space, but I > considered the matter and determined that two were better. > > In the new line we have two different separators (: and =3D) because ther= e > are two levels of info being presented; in the show_hash_info one we > have only one type of separator. > > I'm not saying this is final and definite. I'm just saying I did > consider this whole format issue and what you see is the conclusion I > reached. It may or may not be what Ashutosh submitted -- I don't > remember. As committer, I almost always tweak submitted patches, and I > won't apologize for that. Further patches to correct my mistakes and > bad decisions always welcome. I don't have a preference myself. But now that you explain it, two spaces between unit and next entity does seem a better choice. I had used ",", which faced a minor objection. Thanks for that modification. I failed to notice it in the beginning. Sorry. > > > > (Also, I first thought that "peek" should be "peak", but eventually I > > > realized that's it's as intended.) > > > > Don't understand the context. But probably it doesn't matter. > > Source code always matters. Why would people spend so much time fixing > typos otherwise? > > src/backend/commands/explain.c: > static bool peek_buffer_usage(ExplainState *es, const BufferUsage *usage)= ; > Ah! Thanks for sharing the context. Without that context, I didn't understand Justin's comment. I had reviewed this change post-commit and knew very much that its peek and not peak. I also note that it's better than show_planning :). --=20 Best Wishes, Ashutosh Bapat