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 1jglfc-0006mX-KW for pgsql-performance@arkaria.postgresql.org; Thu, 04 Jun 2020 08:56:16 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1jglfb-00087u-4f for pgsql-performance@arkaria.postgresql.org; Thu, 04 Jun 2020 08:56:15 +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 1jglfa-00087n-PT for pgsql-performance@lists.postgresql.org; Thu, 04 Jun 2020 08:56:14 +0000 Received: from mail-ed1-x542.google.com ([2a00:1450:4864:20::542]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1jglfT-0002gu-Mx for pgsql-performance@lists.postgresql.org; Thu, 04 Jun 2020 08:56:14 +0000 Received: by mail-ed1-x542.google.com with SMTP id w7so4054840edt.1 for ; Thu, 04 Jun 2020 01:56:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=2ndquadrant-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to; bh=OuJIny3ZkWKB336z0ajH6BzJyN5GErk3m0pFn+2F3s8=; b=pnl9BAERSosnjtCbugVsQekkCzN+oz/ltkcy/7ez8alxdlU4wXM5oQYKORDueeiO8M NdOmdcRaaUcqKw0GRzCl3UShPdurIUrvDsvrWk67kx+DerkzDlJa6XwMUxmhuvX7MBhw ZIbNbKPatmBsHlpWHdmkMphANdZRFkFVgrTZo8ASHlDGucVr/HaRufoyi/inI5Xo393T qs2K1UOODCEuJBk+sE8e8lsmI8DgiuF2dL2HE3m8MSCy6ZdLgceaYlvTL4aDKOwxatPD Y2RQVbx+qIta0cw6uxTfNYk083opLsWsp9DTf+Lbgc/VUcCOfDeeZ4FYWwc4egIOBOGP F5qQ== 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:content-transfer-encoding :in-reply-to; bh=OuJIny3ZkWKB336z0ajH6BzJyN5GErk3m0pFn+2F3s8=; b=rFJzAZSOgBimMmtq2q0CEK4208vihVRbfGsLfG8kDqMzK+ndRk+fPtV5qGt0tfS1Ak 0Tiydv3A4X4R7s3HOs3lN1uuDO4YBupAMRVr4x1yA9oUVzI9WH65hGaf2xyrfV7b35TU RSbKDNNPayQt01pB9Utulrr/pRE5uXrwwd5YzKt7bhUgVROzLo9hKwWBLyPAAmR5Kvi1 nsR5wXeHi+ma0CxjW6iO9PN5vkxixuk+v/ii5JnDRMo2Ke21Z+ywzqInVJc2vow1jxIW zKqHN0O7NoYMSMluxR7jaIS/kfP/7506w0NJJFTjUBLIMND8TZlWRUYdh3uKdTixobVX ESoA== X-Gm-Message-State: AOAM532pLBhhQbDNUKR0xkRUcENINmTRiwHvadOsx2QHBIIPjKE30uKs 5TuB4YyqOGMsmRRP2f2PWg+qTw== X-Google-Smtp-Source: ABdhPJy7LxdbkR6mweNp5qg2wW3CIlSkdlec1KcTUkqSNKohrfZv3N26z0chvYIg6K7AAZag+XtulQ== X-Received: by 2002:aa7:d158:: with SMTP id r24mr3254645edo.272.1591260966711; Thu, 04 Jun 2020 01:56:06 -0700 (PDT) Received: from localhost (ip-86-49-253-141.net.upcbroadband.cz. [86.49.253.141]) by smtp.gmail.com with ESMTPSA id z27sm1603732ejf.10.2020.06.04.01.56.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Jun 2020 01:56:05 -0700 (PDT) Date: Thu, 4 Jun 2020 10:56:04 +0200 From: Tomas Vondra To: Philip Semanchuk Cc: Justin Pryzby , pgsql-performance@lists.postgresql.org Subject: Re: increased max_parallel_workers_per_gather results in fewer workers? Message-ID: <20200604085604.xvhr4earrplt73qv@development> References: <20200603211526.GU30144@telsasoft.com> <1F407302-1203-41DB-9A9C-69EA0FAFDCC6@americanefficient.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <1F407302-1203-41DB-9A9C-69EA0FAFDCC6@americanefficient.com> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On Wed, Jun 03, 2020 at 06:23:57PM -0400, Philip Semanchuk wrote: > > ... > >I then ran the EXPLAIN ANALYZE and got the same slow runtime (1473s) and 1 worker in the EXPLAIN ANALYZE output. > > >> I guess you should show an explain analyze, specifically "Workers >> Planned/Launched", maybe by linking to explain.depesz.com > >Out of an abundance of caution, our company has a policy of not pasting our plans to public servers. However, I can confirm that when I set max_parallel_workers_per_gather > 4 and the runtime increases, this is what’s in the EXPLAIN ANALYZE output: > > Workers Planned: 1 > Workers Launched: 1 > >FWIW, the Planning Time reported in EXPLAIN ANALYZE output doesn’t vary significantly, only from 411-443ms, and the variation within that range correlates only very weakly with max_parallel_workers_per_gather. > Well, that policy is stupid and it makes it unnecessarily harder to answer your questions. We really need to see the plans, it's much harder to give you any advices without it. We can only speculate about what's going on. It's understandable there may be sensitive information in the plan (parameter values, ...) but that can be sanitized before posting. We need to see plans for the good and bad case, so that we can compare them, look at the plan general shapes, costs, etc. regards -- Tomas Vondra http://www.2ndQuadrant.com PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services