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 1ldq0I-0003Ue-2z for pgsql-general@arkaria.postgresql.org; Tue, 04 May 2021 08:02:02 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1ldq0H-0005Wj-2R for pgsql-general@arkaria.postgresql.org; Tue, 04 May 2021 08:02:01 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ldpfs-000758-7J for pgsql-general@lists.postgresql.org; Tue, 04 May 2021 07:40:56 +0000 Received: from starship.nidsa.net ([212.227.110.112]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ldpfp-0002w8-Kx for pgsql-general@lists.postgresql.org; Tue, 04 May 2021 07:40:55 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=nidsa.net; s=k1; h=MIME-Version:Content-Transfer-Encoding:Content-Type:In-Reply-To:References:Message-ID:Date:Subject:CC:To:From; bh=zs0iQyxQvtKTR3XPno3wdDE/hArpaTcMc6fMgS73GGY=; b=XzVWT9bYLmvfXnXaX+CrqLo1pU42nvmqRsdSPCHuIs/yr3Q4bVrjI4a3+sNE1l0E0XpjKSaq5S0zZ5/Ylk68Y4GD3Ruvz9x8n7qTXwS9OqHKgExOxpHDQpKFBgweahAmQFRpiK0D84Lojm8eexAsB2V6Xt+d3VmqL3qxAnVXGBg=; Received: from [10.13.1.101] (port=62504 helo=starship.nidsa.net) by starship.nidsa.net with esmtps (TLSv1.2:AES256-SHA:256) (Exim 4.82_1-5b7a7c0-XX) (envelope-from ) id 1ldpfb-0003VH-1Z; Tue, 04 May 2021 09:40:39 +0200 Received: from W2012-02.nidsa.loc (10.13.1.101) by W2012-02.nidsa.loc (10.13.1.101) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Tue, 4 May 2021 09:40:32 +0200 Received: from W2012-02.nidsa.loc ([::1]) by W2012-02.nidsa.loc ([::1]) with mapi id 15.00.1497.015; Tue, 4 May 2021 09:40:32 +0200 X-CTCH-RefID: str=0001.0A782F20.6090FA77.00BB,ss=1,re=0.000,recu=0.000,reip=0.000,cl=1,cld=1,fgs=0 From: Hans Buschmann To: Thomas Munro CC: "pgsql-general@lists.postgresql.org" Subject: AW: Huge performance penalty with parallel queries in Windows x64 v. Linux x64 Thread-Topic: Huge performance penalty with parallel queries in Windows x64 v. Linux x64 Thread-Index: AQHXQAWrShoq7x0Xz0Wq9zLlEAhTo6rSau+AgACDQ0k= Date: Tue, 4 May 2021 07:40:32 +0000 Message-ID: <1620114038935.30845@nidsa.net> References: <1620037591174.76116@nidsa.net>, In-Reply-To: Accept-Language: de-DE, en-US Content-Language: de-DE X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-exchange-transport-fromentityheader: Hosted x-originating-ip: [185.101.185.196] Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk =0A= >No Windows here, but could it be super slow at launching workers? How=0A= >does a trivial parallel query compare, something like?=0A= =0A= >SET force_parallel_mode =3D on;=0A= >EXPLAIN ANALYZE SELECT 42;=0A= =0A= indeed this query takes about 40ms in windows and 7ms on Linux (lowest valu= es).=0A= =0A= Due to remoting the machine the reported times vary quite a bit.=0A= =0A= The problem seems that this (probably inherent) performance disadvantage of= windows is not reflected in the cost model.=0A= =0A= This causes little to middle complex queries to prioritize parallel executi= on on windows which is certainly not the best option in these cases.=0A= =0A= The starting of processes should have an adequate cost penalty to guide the= planner in the right direction.=0A= =0A= Generally disabling parallel queries seems not a viable option with mixed l= oads.=0A= =0A= Here are the query plans:=0A= =0A= QUERY PLAN Windows=0A= ---------------------------------------------------------------------------= -----------------=0A= Gather (cost=3D1000.00..1000.11 rows=3D1 width=3D4) (actual time=3D34.995= ..38.207 rows=3D1 loops=3D1)=0A= Workers Planned: 1=0A= Workers Launched: 1=0A= Single Copy: true=0A= -> Result (cost=3D0.00..0.01 rows=3D1 width=3D4) (actual time=3D0.004.= .0.004 rows=3D1 loops=3D1)=0A= Planning Time: 0.016 ms=0A= Execution Time: 39.136 ms=0A= (7 Zeilen)=0A= =0A= QUERY PLAN Linux=0A= ---------------------------------------------------------------------------= ---------------=0A= Gather (cost=3D1000.00..1000.11 rows=3D1 width=3D4) (actual time=3D6.864.= .7.764 rows=3D1 loops=3D1)=0A= Workers Planned: 1=0A= Workers Launched: 1=0A= Single Copy: true=0A= -> Result (cost=3D0.00..0.01 rows=3D1 width=3D4) (actual time=3D0.002.= .0.003 rows=3D1 loops=3D1)=0A= Planning Time: 0.026 ms=0A= Execution Time: 7.812 ms=0A= (7 rows)=0A= =0A= =0A= Hans Buschmann=