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 1jm6dZ-0007GO-Ai for pgsql-hackers@arkaria.postgresql.org; Fri, 19 Jun 2020 02:20: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 1jm6dW-00080C-VO for pgsql-hackers@arkaria.postgresql.org; Fri, 19 Jun 2020 02:20:10 +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 1jm6dW-000804-Jh for pgsql-hackers@lists.postgresql.org; Fri, 19 Jun 2020 02:20:10 +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 1jm6dT-0006hl-70 for pgsql-hackers@lists.postgresql.org; Fri, 19 Jun 2020 02:20:09 +0000 Received: by mail-io1-xd42.google.com with SMTP id u13so9564663iol.10 for ; Thu, 18 Jun 2020 19:20:06 -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=MLiLYo1eTs/ZKnC+Fvny1rXVbyGZBClR6xkcG2ESKag=; b=aJaDY6jO1+kQdWxVkULpZLU8+wb+aVrn0zWTVE78KYxTzAFDvJLwpdvC2lkOMKuzmw Ge5Po4gXV/B1t6anY+GHsxWGsG1TbY1Mh1Hn8mkck1CY0wH3aDpZzXSgiheIHyoI3QT3 uDj82pIw5bVc5Hm/J42EeWgkl+EeoqoDJ0EVJlunm+50dmt0gKcj8Rq8GiAcGXwq/PKD bP+iDgxkRqfYE5W6bB4CfTIcmFRCdDg4dQ68nIECZnJBjV19uKdCLZWw5FmkriItDSc+ E4fzh4XwZZ46aH3ZN0ToFqLLz8fk29UvfSZSa4NAOjMYpCNogC1FPgqO5j3mpJQ7GSaF 9SBg== 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=MLiLYo1eTs/ZKnC+Fvny1rXVbyGZBClR6xkcG2ESKag=; b=hvQHpX9hAQTrQ6zTdhIwYPqQ2azvblTotI4BBhUGQfCS11xGrCDhqWNSk4W64wXxFe TbY6kGM+j8KhzBmHc/p4Jxk2cZHPmvp9QFfizwmpGOuXo5m7E7fotlExvncYYIpH+vFO 2ZJ5wyJEKRDdyqQTTKJYkM8LLymqCcJUPqkSz8N2/ugU+OP4taqaIAY8nKIt+PRimaGt obTQwql6vd7yGKVWSQ8COtVSkVYm2WsnAPBgZ9pRewO1fM3fDSA+74qr7EMJjUhFAtMB Q7qP85k0Qizgk4lhggwcKfAmqeKgAe8ikLQUyAqAD1VUaG4G23iZlCponcm8oSkqn80t ViBA== X-Gm-Message-State: AOAM532mKVAUqQlKlCJAnPLam8znBo4eCIvQjosmbCSZlLR+WCBD2MKU N4nz1Bfb6KC7YK23wOZCqJvzww== X-Google-Smtp-Source: ABdhPJzx2btqkS0/+FwxvX84bMkn1cUtwMnIVJ2DXJNunVV4ExsPnfmq/mvLHO4qfC9ay0BTG6I0Ug== X-Received: by 2002:a5d:80d2:: with SMTP id h18mr194694ior.73.1592533204490; Thu, 18 Jun 2020 19:20:04 -0700 (PDT) Received: from pryzbyj.telsasoft (charmander.telsasoft.com. [50.244.222.1]) by smtp.gmail.com with ESMTPSA id z4sm2603308iot.24.2020.06.18.19.20.03 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 18 Jun 2020 19:20:03 -0700 (PDT) Received: by pryzbyj.telsasoft (Postfix, from userid 1000) id BE33380086E; Thu, 18 Jun 2020 21:20:01 -0500 (CDT) Date: Thu, 18 Jun 2020 21:20:01 -0500 From: Justin Pryzby To: David Rowley Cc: pgsql-hackers@lists.postgresql.org, Jeff Davis Subject: Re: Missing HashAgg EXPLAIN ANALYZE details for parallel plans Message-ID: <20200619022001.GY17995@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: > On Fri, 19 Jun 2020 at 01:45, Justin Pryzby wrote: > > Note that "incremental sort" is also new, and splits things up more than sort. > > > > See in particular 6a918c3ac8a6b1d8b53cead6fcb7cbd84eee5750, which splits things > > up even more. > > > > -> Incremental Sort (actual rows=70 loops=1) > > Sort Key: t.a, t.b > > Presorted Key: t.a > > - Full-sort Groups: 1 Sort Method: quicksort Memory: avg=NNkB peak=NNkB Presorted Groups: 5 Sort Methods: top-N heapsort, quicksort Memory: avg=NNkB peak=NNkB > > + Full-sort Groups: 1 Sort Method: quicksort Average Memory: NNkB Peak Memory: NNkB > > + Pre-sorted Groups: 5 Sort Methods: top-N heapsort, quicksort Average Memory: NNkB Peak Memory: NNkB > > > > That's not really a "precedent" and I don't think that necessarily invalidates > > your change. > > I imagine you moved "Per-sorted Groups" to a new line due to the lines > becoming too long? Or was there something else special about that > property to warrant putting it on a new line? https://www.postgresql.org/message-id/20200419023625.GP26953@telsasoft.com |I still think Pre-sorted groups should be on a separate line, as in 0002. |In addition to looking better (to me), and being easier to read, another reason |is that there are essentially key=>values here, but the keys are repeated (Sort |Method, etc). > postgres=# explain analyze select a,sum(b) from ab group by a; > 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 Please be sure to use two spaces between each field ! See earlier discussions (and commits referenced by the Opened Items page). https://www.postgresql.org/message-id/20200402054120.GC14618@telsasoft.com https://www.postgresql.org/message-id/20200407042521.GH2228%40telsasoft.com + appendStringInfoChar(es->str, ' '); + + 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", -- Justin