Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eJFVa-0002gU-Hl for pgsql-hackers@arkaria.postgresql.org; Mon, 27 Nov 2017 09:15:22 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eJFVZ-0006GT-Ll for pgsql-hackers@arkaria.postgresql.org; Mon, 27 Nov 2017 09:15:21 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1eJFVZ-0006Fu-8n for pgsql-hackers@lists.postgresql.org; Mon, 27 Nov 2017 09:15:21 +0000 Received: from lana.depesz.com ([88.198.49.178] helo=depesz.com) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1eJFVQ-0002Fz-Ez for pgsql-hackers@postgresql.org; Mon, 27 Nov 2017 09:15:19 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=depesz.com; s=20170201; h=In-Reply-To:Content-Type:MIME-Version:References:Reply-To:Message-ID:Subject:Cc:To:Sender:From:Date; bh=6lNb1G6YXPW4hLznyWZiF6Z+Nob1G2UEg+aF8jT/s4U=; b=Co6FT5D0bWBUd9rucKRXG/N00vFdWVdgXYQUjxhQTz/xJrm6w2Ns86BDE54pOHj1suNhddaJrNbegf51ryiNIP8gcNxc7JJWjey8No11kH2tD3g4Sm6BE4QgP4Ve3HwV/1NZ3BOF9NAI39xQiUcQCPuVH/ActePXfls2DcgBCkE=; Received: from lana.depesz.com ([88.198.49.178] helo=depesz.com) by depesz.com with esmtpa (Exim 4.84_2) (envelope-from ) id 1eJFVN-0005iA-4g; Mon, 27 Nov 2017 10:15:09 +0100 Date: Mon, 27 Nov 2017 10:15:08 +0100 From: hubert depesz lubaczewski Sender: depesz@depesz.com To: Amit Kapila Cc: pgsql-hackers mailing list Subject: Re: explain analyze output with parallel workers - question about meaning of information for explain.depesz.com Message-ID: <20171127091508.GA2525@depesz.com> Reply-To: depesz@depesz.com References: <20171124112151.GA6616@depesz.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On Sat, Nov 25, 2017 at 07:08:03AM +0530, Amit Kapila wrote: > > For example, check step 13 in https://explain.depesz.com/s/gNBd > > > > It shows time of 3ms, but loops of 1873, so the actual time is ~ 5600ms. > > > > But with parallel execution it seems to be no longer the case. > > > > For example: > > https://explain.depesz.com/s/LTMp > > or > > https://explain.depesz.com/s/QHRi > > Should I, for explain.depesz.com, when dealing > > with partial* and parallel* nodes, use "loops=1" for calculation of > > exclusive/inclusive time? always? some other nodes? > > > > I am not sure what exactly inclusive or exclusive means, but for > parallel nodes, total stats are accumulated so you are seeing loops as > 'worker nodes + 1'. Now, as presumably workers run parallelly, so I > think the actual time will be what will be shown in the node not > actual time * nloops. Please check the plans: https://explain.depesz.com/s/gNBd (step 13) and https://explain.depesz.com/s/LTMp (step 3) Inclusive time is basically "loops * actual time", so for Index Scan, which had 1873 loops and actual time of 3.002..3.016, we got 1873 * 3.016 = 5648.968ms. In case of parallel workers it looks like the inclusive time is basically the upper value from actual time. The question now is: how can I tell which nodes should use "actual_time * 1" and which "actual_time * loops" time? Anything "below" "Gather"? Anything starting with "Partial?" Anything starting with "Parallel"? Anything with "Worker" in node "description" in explain? depesz