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 1jtCxr-0007oZ-MB for pgsql-hackers@arkaria.postgresql.org; Wed, 08 Jul 2020 16:30:31 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1jtCxo-000533-I8 for pgsql-hackers@arkaria.postgresql.org; Wed, 08 Jul 2020 16:30:28 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jtCxo-00052q-7Y for pgsql-hackers@lists.postgresql.org; Wed, 08 Jul 2020 16:30:28 +0000 Received: from mail-io1-xd42.google.com ([2607:f8b0:4864:20::d42]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1jtCxl-0001GP-A2 for pgsql-hackers@lists.postgresql.org; Wed, 08 Jul 2020 16:30:27 +0000 Received: by mail-io1-xd42.google.com with SMTP id q74so24104661iod.1 for ; Wed, 08 Jul 2020 09:30:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telsasoft-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=mrpTHrt8AtosrFo0eigX8rtzGC5gO+2JYkH3oPZPbdw=; b=SH3nfuwHQBbto1JZ1iaPDUintepXbEe+h832xMyFJ/BGONOrw2gDiOnNsPVYQIV8u1 vYmcAiYuho8VO+mapFcDbz8fJgWb6u6fO2EOeDCqPJHzpPJbvWtXuLXfAAh/s+FyAZAt Tbkl7PUru5vtXzS76yQeRM5TW8xzVX2/RQwxlxd8qebeLZog+a3f12Uq7NMpywsplHXK BEcSYAcIUpptfycYpl73oX0Dg8Y8/Ob2CpWhntd7B6xJK1AQJP/e2OfetXAMTrxYb9QG M6NGQnim4mdbQHFRUJC5EK0HRNJ0kC+r+jCydw3npBsqSJoLmblV8KbsVAZwd/7Im58Q gdMQ== 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:user-agent; bh=mrpTHrt8AtosrFo0eigX8rtzGC5gO+2JYkH3oPZPbdw=; b=b2YkLmB7e8smEtkdASExfc2YBabYXWuNuIxWVq4Ce2l2rMcANGgDqea67XI8CfYlYi h/zkq7pQ4IoogWWCIvn1HLWgrY3dQYMpiGxyrPYEO7/fZa53MJpiaFZ0gjxm15AC8WiG D87b8XCkPkHUVxUuxUN6/v6VFdTqNkex12WkNCdbFxqQrUQ62xD1bMMY3oVcHj9p7e6P 343lpFUKbyo5pe34E/ucQA43PKKAoFtxZCjkJ5vdhr2hUKDWa7cvLytQNRfeDk4LrRKW f7Xt6q1/XXwSj/XVoYGFuh2Bs0JwUh3BDnvWNw2C0eUGAczwiRj0eiKocD3+DkA+YN93 p0gw== X-Gm-Message-State: AOAM5319Vjm/g97K4CuW5hBIutdXkn6WSL5nrUCnc7Pn+MAn8/mUZA0x yBQavdwTX69rCxridHkphAZ2XQ== X-Google-Smtp-Source: ABdhPJwz3sbrRCP9UyXRBkYsEjRVdynFy7xCXjIVrLdbFEL2dBfWaYk0qdU1dDZa7RsBk9c1dc2UbQ== X-Received: by 2002:a02:6d1b:: with SMTP id m27mr51500718jac.129.1594225823487; Wed, 08 Jul 2020 09:30:23 -0700 (PDT) Received: from pryzbyj.telsasoft (charmander.telsasoft.com. [50.244.222.1]) by smtp.gmail.com with ESMTPSA id o16sm116359ilt.59.2020.07.08.09.30.22 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 08 Jul 2020 09:30:22 -0700 (PDT) Received: by pryzbyj.telsasoft (Postfix, from userid 1000) id A7D37800950; Wed, 8 Jul 2020 11:30:21 -0500 (CDT) Date: Wed, 8 Jul 2020 11:30:21 -0500 From: Justin Pryzby To: David Rowley Cc: PostgreSQL Developers , Jeff Davis Subject: Re: Missing HashAgg EXPLAIN ANALYZE details for parallel plans Message-ID: <20200708163021.GW4107@telsasoft.com> References: <20200618134514.GF17995@telsasoft.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.4 (2018-02-28) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On Fri, Jun 19, 2020 at 02:02:29PM +1200, David Rowley wrote: > if (es->format == EXPLAIN_FORMAT_TEXT) > { > ExplainIndentText(es); > appendStringInfo(es->str, "Sort Method: %s %s: %ldkB\n", ... > As for this patch, I don't think it's unreasonable to have the 3 > possible HashAgg properties on a single line Other people might > disagree, so here's an example of what the patch changes it to: > > postgres=# explain analyze select a,sum(b) from ab group by a; > QUERY PLAN > -------------------------------------------------------------------------------------------------------------------- > HashAggregate (cost=175425.12..194985.79 rows=988 width=12) (actual > time=1551.920..5281.670 rows=1000 loops=1) > Group Key: a > Peak Memory Usage: 97 kB Disk Usage: 139760 kB HashAgg Batches: 832 > -> Seq Scan on ab (cost=0.00..72197.00 rows=5005000 width=8) (actual time=0.237..451.228 rows=5005000 loops=1) I've just noticed another inconsistency: For "Sort", there's no space before "kB", but your patch (9bdb300d) uses a space for text mode. + appendStringInfo(es->str, "Peak Memory Usage: " INT64_FORMAT " kB", + memPeakKb); + + if (aggstate->hash_batches_used > 0) + appendStringInfo(es->str, " Disk Usage: " UINT64_FORMAT " kB HashAgg Batches: %d", ... + appendStringInfo(es->str, "Peak Memory Usage: " INT64_FORMAT " kB", + memPeakKb); + + if (hash_batches_used > 0) + appendStringInfo(es->str, " Disk Usage: " UINT64_FORMAT " kB HashAgg Batches: %d", Hopefully there's the final whitespace inconsistency for this release. -- Justin