Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1csiek-0002Fv-9K for pgsql-hackers@arkaria.postgresql.org; Tue, 28 Mar 2017 04:22:54 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1csiej-0002qp-Ot for pgsql-hackers@arkaria.postgresql.org; Tue, 28 Mar 2017 04:22:53 +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 1csidE-0000AN-Pk for pgsql-hackers@postgresql.org; Tue, 28 Mar 2017 04:21:21 +0000 Received: from mail-qt0-x235.google.com ([2607:f8b0:400d:c0d::235]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84_2) (envelope-from ) id 1csidB-000589-S9 for pgsql-hackers@postgresql.org; Tue, 28 Mar 2017 04:21:19 +0000 Received: by mail-qt0-x235.google.com with SMTP id x35so54797145qtc.2 for ; Mon, 27 Mar 2017 21:21:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=2ndquadrant-com.20150623.gappssmtp.com; s=20150623; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=3xUGwPAHr9KahONWi+xUI81MdXHMLfBHDj053l2HzYQ=; b=UwaTz6/DG6PjcDiKpWswsQaiyONqeCQfrTsIVH0zI/NQy/5xgePOE1xbDd1NbtZgBn 513eYT4l+ru/QXdZ1T6JYAq2cVkF6l44rhszoLwDpTfW8WArRH5sbEaBMW3XUNw7++ge jZ6Vev+osozbxypi/2c1lyYdS2uCOh2gdm1tuY2XNiCQu9+q8nJE8EW8OGK3ou5MzvxT st7NGxULqRpoiHjnimTr/it40WgWfxd/yNs/wGoBGMH+0wogfy9bqMVdLKBlji4H6p1I NyJH0cwvy0dbSzLiR/C7ApXSoM+STT3J9jyhQ5K1XMAy7RHUTA7ANWmxGAnshQOktjYY k25A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=3xUGwPAHr9KahONWi+xUI81MdXHMLfBHDj053l2HzYQ=; b=DSxcAxIpwHWTZcplHzWOcupqYx1Or//l75eBBlNvcNaBxk8Og9LggtV8F7esLlR157 WVZTOAKjKCE9hzDEdZh/UsoqdPPqt8pEdrcYZQ6vPgaLqAcvcI04uDuPGVv/MMP17mvN Z/4LE00pUsWMe6uAoG6oaAYxju7j4K7EdXAYZuD8BCfqWOfdGtmjUhJ7AGgU2lguw27t jHwVS9EaYC9jx25nl6SZXCZZinZss20yYwa2T4kpZCHN+fIH7+M+A6IDCwb7CpNmaJV6 5xBrYuSiFhH+s5vvhU+i1ROwzA5i1g73m8moZeVDJIYD6dkWNfqKomODTFcPP0ERy/Rh aBug== X-Gm-Message-State: AFeK/H0I8msl9Pj3V4HCVJvgoYGxMNC3SgmZ7AS1CmBTpGwmRMVlEE8thCXYnxlizQ8JHzenR7fbXPCX3DytVGNZs2lpzt0Ze4vy/xakaUm83wmejfcg2Qsr3iF+4aRxASn++7bh6Hhvy8o1s/gUQByEmvShZ0W7/4EIdB8LkbQO5PqTQ4SEpoOgldoXERiPr4RwTzrrIEMb X-Received: by 10.237.57.164 with SMTP id m33mr26529528qte.293.1490674876609; Mon, 27 Mar 2017 21:21:16 -0700 (PDT) Received: from [10.137.1.17] ([208.123.164.34]) by smtp.gmail.com with ESMTPSA id v133sm1851828qkb.24.2017.03.27.21.21.15 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 27 Mar 2017 21:21:15 -0700 (PDT) Subject: Re: crashes due to setting max_parallel_workers=0 To: Robert Haas , Tom Lane Cc: Rushabh Lathia , Peter Eisentraut , David Rowley , PostgreSQL-development References: <6ecd6f17-0dcf-1de7-ded8-0de7db1ddc88@2ndquadrant.com> <16476.1490622853@sss.pgh.pa.us> From: Tomas Vondra Message-ID: Date: Tue, 28 Mar 2017 06:21:13 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.0a2 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Pg-Spam-Score: -1.9 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-hackers Precedence: bulk Sender: pgsql-hackers-owner@postgresql.org On 03/27/2017 05:51 PM, Robert Haas wrote: > On Mon, Mar 27, 2017 at 9:54 AM, Tom Lane wrote: >> Robert Haas writes: >>> On Mon, Mar 27, 2017 at 1:29 AM, Rushabh Lathia >>> wrote: >>>> But it seems a bit futile to produce the parallel plan in the first place, >>>> because with max_parallel_workers=0 we can't possibly get any parallel >>>> workers ever. I wonder why compute_parallel_worker() only looks at >>>> max_parallel_workers_per_gather, i.e. why shouldn't it do: >>>> parallel_workers = Min(parallel_workers, max_parallel_workers); >>>> Perhaps this was discussed and is actually intentional, though. >> >>> It was intentional. See the last paragraph of >>> https://www.postgresql.org/message-id/CA%2BTgmoaMSn6a1780VutfsarCu0LCr%3DCO2yi4vLUo-JQbn4YuRA@mail.gmail.com >> >> Since this has now come up twice, I suggest adding a comment there >> that explains why we're intentionally ignoring max_parallel_workers. > > Hey, imagine if the comments explained the logic behind the code! > > Good idea. How about the attached? > Certainly an improvement. But perhaps we should also mention this at compute_parallel_worker, i.e. that not looking at max_parallel_workers is intentional. regards -- Tomas Vondra http://www.2ndQuadrant.com PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers