Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jKbuf-0000wW-26 for pgsql-hackers@arkaria.postgresql.org; Sat, 04 Apr 2020 06:04:13 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1jKbu7-0007gP-Ox for pgsql-hackers@arkaria.postgresql.org; Sat, 04 Apr 2020 06:03:39 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jKbu7-0007d4-F9 for pgsql-hackers@lists.postgresql.org; Sat, 04 Apr 2020 06:03:39 +0000 Received: from mail-wm1-x32a.google.com ([2a00:1450:4864:20::32a]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1jKbu0-0002YW-Sb for pgsql-hackers@postgresql.org; Sat, 04 Apr 2020 06:03:38 +0000 Received: by mail-wm1-x32a.google.com with SMTP id h2so1258523wmb.4 for ; Fri, 03 Apr 2020 23:03:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=3GTnlZ+Pnh8auK28E6SrZxbr7Lk7o0pN3K19YllkowA=; b=lP4sIcRJ2nUmiFEf07s6i9STeKh/eWdSA/nyG/Jaa8dPQzwxmuJKCC7ZJVgSa8fSLx Gq+jQaaVNutXFQ/sI/i3Fo/6B0c3l1hZco5n34vz7uDNswh7fv5IoeS1VkDVC++3eUtN niMuOt5rPTvkLnJfGoP8tcCypE/blBdkxeHsq3+FkTiFOBxEU0AI3q8npW4n3ACWAiuS 61ckUdpHK3uF+stHJ59bWesx+LqqNFAdCGpgfj9uw4d53p5bY1KFkd0KfBdvLnZ5BvkN ehfbrCOUyApJlRtweUtF8XxchtXAe0nIOjlN/l2fRXB+lQUPE+Yo8fUQMzdfkipd/h98 McxA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=3GTnlZ+Pnh8auK28E6SrZxbr7Lk7o0pN3K19YllkowA=; b=LzFSpWKYKD0yvDCf1hR4/lKXA2g4A3xlYymbM/D7Q4+AJMj+QHWVIfvzMv/VPDb0js MXw0x7fBi5lH/zTFRmxZu++3lIi4NtalPJfyheT792yieFb58m6gZ4xanv6GyOqZROlU TtNYLCfCMBKgE0a/ZbO6xbY0835o/eKRE3dyTConzf2guhIWFQN2roXgPeGTfw0uDZrr 5+voHPyfSMbmKTi0PmImQV+aSyiclbTLwMV1y2zMhetErStqgwG2lzFI5s7FHtAvoA1i i4iRyM0aPONyC+yGpnEmlhXMGuNnY4wcHdUY9Lqis04MKdM+yXpWGfpyPl5ZhX0s4bNS /uGg== X-Gm-Message-State: AGi0PualgmdiRx40cfn01rIH1Qz+zYRn6HFfOcyIv07lbIfJm1lStHGI 9X+fGhLWD1pPuVWE13wcd5M= X-Google-Smtp-Source: APiQypKkJxPoEiR9op+xiifaBT+BWQayAlAHpin7eMQCpxic8sJdhjk8YnN7j+f0AD+P7R0cimIuig== X-Received: by 2002:a7b:cde8:: with SMTP id p8mr12073347wmj.87.1585980210879; Fri, 03 Apr 2020 23:03:30 -0700 (PDT) Received: from nol ([2a01:e0a:c:bcf0:dbc8:f7e9:89ae:5cd7]) by smtp.gmail.com with ESMTPSA id l12sm14971117wrt.73.2020.04.03.23.03.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 Apr 2020 23:03:30 -0700 (PDT) Date: Sat, 4 Apr 2020 08:03:03 +0200 From: Julien Rouhaud To: Amit Kapila Cc: Dilip Kumar , Kuntal Ghosh , Fujii Masao , Kirill Bychik , PostgreSQL Hackers , Thomas Munro Subject: Re: WAL usage calculation patch Message-ID: <20200404060303.n2q74lbccjm2swdc@nol> References: <20200402124818.GD64485@nol> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On Sat, Apr 04, 2020 at 10:38:14AM +0530, Amit Kapila wrote: > On Fri, Apr 3, 2020 at 7:36 PM Amit Kapila wrote: > > > > On Fri, Apr 3, 2020 at 9:40 AM Amit Kapila wrote: > > > > > > On Fri, Apr 3, 2020 at 9:35 AM Dilip Kumar wrote: > > > > > > > > I have analyzed the WAL and there could be multiple reasons for the > > > > same. With small data, I have noticed that while inserting in the > > > > system index there was a Page Split and that created extra WAL. > > > > > > > > > > Thanks for the investigation. I think it is clear that we can't > > > expect the same WAL size even if we repeat the same operation unless > > > it is a fresh database. > > > > > > > Attached find the latest patches. I have modified based on our > > discussion on user interface thread [1], ran pgindent on all patches, > > slightly modified one comment based on Dilip's input and added commit > > messages. I think the patches are in good shape. I would like to > > commit the first patch in this series tomorrow unless I see more > > comments or any other objections. > > > > Pushed. Thanks! > > The patch-2 might need to be > > rebased if the other related patch [2] got committed first and we > > might need to tweak a bit based on the input from other thread [1] > > where we are discussing user interface for it. > > > > The primary question for patch-2 is whether we want to include WAL > usage information for the planning phase as we did for BUFFERS in > recent commit ce77abe63c (Include information on buffer usage during > planning phase, in EXPLAIN output, take two.). Initially, I thought > it might be a good idea to do the same for WAL but after reading the > thread that leads to commit, I am not sure if there is any pressing > need to include WAL information for the planning phase. Because > during planning we might not write much WAL (with the exception of WAL > due to setting of hint-bits) so users might not care much. What do > you think? I agree that WAL activity during planning shouldn't be very frequent, but it might still be worthwhile to add it. I'm wondering how stable the normalized WAL information would be in some regression tests, as the counters are only showed if non zero. Maybe it'd be better to remove them from the output, same as the buffers?