Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.92) (envelope-from ) id 1jIX6X-0007Va-VM for pgsql-hackers@arkaria.postgresql.org; Sun, 29 Mar 2020 12:31:54 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1jIX6W-0004RN-C2 for pgsql-hackers@arkaria.postgresql.org; Sun, 29 Mar 2020 12:31:52 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1jIX6V-0004N2-T1 for pgsql-hackers@lists.postgresql.org; Sun, 29 Mar 2020 12:31:52 +0000 Received: from mail-lj1-x243.google.com ([2a00:1450:4864:20::243]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1jIX6S-0001nt-29 for pgsql-hackers@postgresql.org; Sun, 29 Mar 2020 12:31:50 +0000 Received: by mail-lj1-x243.google.com with SMTP id n17so14879769lji.8 for ; Sun, 29 Mar 2020 05:31:47 -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=96n8sMqzXZy+K70BybfWMaz4HlNK4winuZvLuPB169w=; b=uqU2TJ5DCts7FyvrDURy2chzo89g8s2YlYqfC0CXpInT7WzNFlDZg+rP3MnEZvWnUA MRCYmojLu4hXNpQlPIKJ6wkVZCTkIcci4ALwqNUD1Qs3bKY/2xWNqRTrtgxf9jN9IQ+X dOsZHyewU+FPeDMfF7NOPouQEvNmMaTh8pDPPJG5orZFeEItHb3pmNJR4pz1WTIxWlNZ KTuX3WFkfFZ9UD1dMem7Ehp85od1DkRhSCwY6KDtqkkqXToQNDuvAntxkxnlz2Gc2Qjl r176bwUDezGDPjytIs5gWjweUVBa9lnse+v54MvhREYSPFefUB43kattiwa/pdtkQ9Lv iuHA== 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=96n8sMqzXZy+K70BybfWMaz4HlNK4winuZvLuPB169w=; b=C/1Pp7NI5gSYZ1k0Dogaf6IQpJA8JaXA9kji73gLzx4Z1e9sX7ciG/u9Kg96GzekT6 z39VWHW6bcz7lKCJSmBpvTDPFzQyf3WnOLVs06MwxNy++vg3GLFDjGVzwBd3mn7xrj2N lYPPIiA20WBIAdlLb19LIx572LH4EV+IBDw7JdQpDU8DPshGURWa6kj0CiX2vXNJDY/k wgFAwTSPW/R2Moulzkn+AZLp8srmGspiTQ5cgfuqHd2gkfPeC2fEnkLyA6F72Hb99l9M c1owUYv+B2xO3h+yrp96YCPqBynz3QJ8r77ch0HKV5rGEaypXakdonoSNPaJbUz3KPQ1 6tbA== X-Gm-Message-State: AGi0PuYAHsLlLt+XtPnAuVmFEFh7gInZzdtt+2BjqaVOVXrlNZJv6K45 8w0vT1Eo/ppgFSExpe8PGxc= X-Google-Smtp-Source: APiQypJ9EQj3YU8xBmDd1CWnZmgbfIhJ37KesJUStdS0S/jXqHlyF4ujIM7ALpPDsACnSOyCQOTiqg== X-Received: by 2002:a2e:b611:: with SMTP id r17mr4563778ljn.62.1585485106343; Sun, 29 Mar 2020 05:31:46 -0700 (PDT) Received: from nol (82-64-124-11.subs.proxad.net. [82.64.124.11]) by smtp.gmail.com with ESMTPSA id y3sm4396631ljh.15.2020.03.29.05.31.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 29 Mar 2020 05:31:44 -0700 (PDT) Date: Sun, 29 Mar 2020 14:31:41 +0200 From: Julien Rouhaud To: Amit Kapila Cc: Kirill Bychik , PostgreSQL Hackers , Fujii Masao , Thomas Munro Subject: Re: WAL usage calculation patch Message-ID: <20200329123141.GB79261@nol> References: <762d4ee8-9710-cdcd-e661-b5c79aaa9bf0@oss.nttdata.com> <20200328133827.GA12854@nol> <20200329075549.6l54fcjfh73rxufb@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 Hi Amit, Sorry I just noticed your mail. On Sun, Mar 29, 2020 at 05:12:16PM +0530, Amit Kapila wrote: > On Sun, Mar 29, 2020 at 1:26 PM Julien Rouhaud wrote: > > > > I'm not sure that I get your point. I'm assuming that you meant > > parallel-read-only queries, but surely buffer usage infrastructure for > > parallel query relies on the same approach as non-parallel one (each node > > computes the process-local pgBufferUsage diff) and sums all of that at the end > > of the parallel query execution. I also don't see how whether the query is > > read-only or not is relevant here as far as instrumentation is concerned, > > especially since read-only query can definitely do writes and increase the > > count of dirtied buffers, like a write query would. For instance a hint > > bit change can be done in a parallel query AFAIK, and this can generate WAL > > records in wal_log_hints is enabled, so that's probably one way to test it. > > > > Yeah, that way we can test it. Can you try that? > > > I now think that not adding support for WAL buffers in EXPLAIN output in the > > initial patch scope was a mistake, as this is probably the best way to test the > > WAL counters for parallel queries. This shouldn't be hard to add though, and I > > can work on it quickly if there's still a chance to get this feature included > > in pg13. > > > > I am not sure we will add it in Explain or not (maybe we need inputs > from others in this regard), but if it helps in testing this part of > the patch, then it is a good idea to write a patch for it. You might > want to keep it separate from the main patch as we might not commit > it. As I just wrote in [1] that's exactly what I did. Using parallel query and concurrent update on a table I could see that WAL usage for parallel query seems to be working as one could expect. > Sure, I am fine with that but I am not sure if it is a good idea to > commit this patch without having a way to compute WAL utilization for > those commands. I'm generally fine with waiting for a fix for the existing issue to be committed. But as the feature freeze is approaching, I hope that it won't mean postponing this feature to v14 because a related 2yo bug has just been discovered, as it would seem a bit unfair.