Re: parallel-processing multiple similar query tasks - any example? - Mailing list pgsql-general

From Shaozhong SHI
Subject Re: parallel-processing multiple similar query tasks - any example?
Date
Msg-id CA+i5JwaRZZZPkpaOtvVOCjLzjwhL0pMrpXGKa8M7Qrr7zS5Mbg@mail.gmail.com
Whole thread Raw
In response to Re: parallel-processing multiple similar query tasks - any example?  (Alvaro Herrera <alvherre@alvh.no-ip.org>)
Responses Re: parallel-processing multiple similar query tasks - any example?  (Alvaro Herrera <alvherre@alvh.no-ip.org>)
List pgsql-general
Expand and explain please.
Regards,
David

On Thursday, 28 April 2022, Alvaro Herrera <alvherre@alvh.no-ip.org> wrote:
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

pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: ERROR: cursor variable must be a simple variable (LINE XX: OPEN vQuery.cursorReturn FOR )
Next
From: Alvaro Herrera
Date:
Subject: Re: parallel-processing multiple similar query tasks - any example?