Re: parallel-processing multiple similar query tasks - any example?

From: Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>
To: Shaozhong SHI <shishaozhong(at)gmail(dot)com>
Cc: pgsql-general <pgsql-general(at)lists(dot)postgresql(dot)org>
Subject: Re: parallel-processing multiple similar query tasks - any example?
Date: 2022-04-28 16:10:00
Message-ID: 202204281610.turgxp6amrah@alvherre.pgsql
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Adrian Klaver 2022-04-28 16:12:55 Re: Backing up a DB excluding certain tables
Previous Message David G. Johnston 2022-04-28 16:09:31 Re: ERROR: cursor variable must be a simple variable (LINE XX: OPEN vQuery.cursorReturn FOR )