Postgresql PL parallel processing inside Postgresql function.... - Mailing list pgsql-general

From Misa Simic
Subject Postgresql PL parallel processing inside Postgresql function....
Date
Msg-id CAH3i69mad1VnTzraT3_S2BbjNca3zhLMxye9K3bC7qHEwdThRQ@mail.gmail.com
Whole thread Raw
Responses Re: Postgresql PL parallel processing inside Postgresql function....  ("David Johnston" <polobo@yahoo.com>)
List pgsql-general
Hi,

I have a table of bunch of records:

MainTable:
-MainID
-Other attributes....


Several Tables what Track Activities about MainIDs...


And one routine written as plpgsql function what Loops trough MainTable and for each record, calls ProccessTheThing(MainID),

What again sequentially calls, several plpgsql functions bellow for one thing...


Main problem is, every single record in MainTable waits to previous record be processed to can continue processing....

Because of they are totally independent, I would like if possible to process several things in the same time if possible?

But inside Postgresql (db_link is acceptable - I could not figure out full picture... I mean, I am aware about the way to send async query to the same db, but could not figure out full flow... i.e. sent first bunch of 10 or 20, 50 - get notice when  1 of them finsihed so can send next one... etc etc)

i.e. Outside Postgresql, It would be possible to from client app, take all MainID from MainTable, loop and call async ProccessTheThing function through several threads... 

Any Suggestions?

Many Thanks,

Misa
 

pgsql-general by date:

Previous
From: Mihai Popa
Date:
Subject: Re: large database
Next
From: Alex Burkoff
Date:
Subject: Re: execution plan is wrong, or the query ?