From: Alvaro Herrera <alvherre@alvh.no-ip.org>
To: Shaozhong SHI <shishaozhong@gmail.com>
Cc: pgsql-general <pgsql-general@lists.postgresql.org>
Subject: Re: parallel-processing multiple similar query tasks - any example?
Date: Thu, 28 Apr 2022 18:10:00 +0200
Message-ID: <202204281610.turgxp6amrah@alvherre.pgsql> (raw)
In-Reply-To: <CA+i5JwamNV4Wi0yOBpSTFW+X3KEt9LdC+qusu6brVoQUG7B0Xg@mail.gmail.com>
On 2022-Apr-28, Shaozhong SHI wrote:
> Why sleep(1)?
It is sleeping to show that they are running concurrently. If it runs
five sleeps of one second each and the whole command lasts one second,
then all sleeps ran in parallel. Had the whole command taken five
seconds, you would know that the queries ran serially.
> It should be all active - doing work concurrently.
They are all active simultaneously. You just need to supply your own
query, without any sleeps.
--
Álvaro Herrera
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: alvherre@alvh.no-ip.org, shishaozhong@gmail.com
Subject: Re: parallel-processing multiple similar query tasks - any example?
In-Reply-To: <202204281610.turgxp6amrah@alvherre.pgsql>
References: <CA+i5JwamNV4Wi0yOBpSTFW+X3KEt9LdC+qusu6brVoQUG7B0Xg@mail.gmail.com> <202204281610.turgxp6amrah@alvherre.pgsql>
* 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