pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Hans Buschmann <buschmann@nidsa.net>
To: Thomas Munro <thomas.munro@gmail.com>
Cc: pgsql-general@lists.postgresql.org <pgsql-general@lists.postgresql.org>
Subject: AW: Huge performance penalty with parallel queries in Windows x64 v. Linux x64
Date: Tue, 4 May 2021 07:40:32 +0000
Message-ID: <1620114038935.30845@nidsa.net> (raw)
In-Reply-To: <CA+hUKG+d+qrOgwU2sqG09De7W6WJp7edWwURcip+_JxoCzxd4A@mail.gmail.com>
References: <1620037591174.76116@nidsa.net>
	<CA+hUKG+d+qrOgwU2sqG09De7W6WJp7edWwURcip+_JxoCzxd4A@mail.gmail.com>


>No Windows here, but could it be super slow at launching workers?  How
>does a trivial parallel query compare, something like?

>SET force_parallel_mode = on;
>EXPLAIN ANALYZE SELECT 42;

indeed this query takes about 40ms in windows and 7ms on Linux (lowest values).

Due to remoting the machine the reported times vary quite a bit.

The problem seems that this (probably inherent) performance disadvantage of windows is not reflected in the cost model.

This causes little to middle complex queries to prioritize parallel execution on windows which is certainly not the best option in these cases.

The starting of processes should have an adequate cost penalty to guide the planner in the right direction.

Generally disabling parallel queries seems not a viable option with mixed loads.

Here are the query plans:

                                         QUERY PLAN Windows
--------------------------------------------------------------------------------------------
 Gather  (cost=1000.00..1000.11 rows=1 width=4) (actual time=34.995..38.207 rows=1 loops=1)
   Workers Planned: 1
   Workers Launched: 1
   Single Copy: true
   ->  Result  (cost=0.00..0.01 rows=1 width=4) (actual time=0.004..0.004 rows=1 loops=1)
 Planning Time: 0.016 ms
 Execution Time: 39.136 ms
(7 Zeilen)

                                        QUERY PLAN Linux
------------------------------------------------------------------------------------------
 Gather  (cost=1000.00..1000.11 rows=1 width=4) (actual time=6.864..7.764 rows=1 loops=1)
   Workers Planned: 1
   Workers Launched: 1
   Single Copy: true
   ->  Result  (cost=0.00..0.01 rows=1 width=4) (actual time=0.002..0.003 rows=1 loops=1)
 Planning Time: 0.026 ms
 Execution Time: 7.812 ms
(7 rows)


Hans Buschmann




view thread (3+ messages)  latest in thread

Message-ID: <1620114038935.30845@nidsa.net>
Permalink:  ../1620114038935.30845@nidsa.net/
Also on:    postgresql.org/message-id/1620114038935.30845@nidsa.net

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: buschmann@nidsa.net, thomas.munro@gmail.com
  Subject: Re: Huge performance penalty with parallel queries in Windows x64 v. Linux x64
  In-Reply-To: <1620114038935.30845@nidsa.net>
  References: <1620037591174.76116@nidsa.net> <CA+hUKG+d+qrOgwU2sqG09De7W6WJp7edWwURcip+_JxoCzxd4A@mail.gmail.com> <1620114038935.30845@nidsa.net>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox