Postgresql PL parallel processing inside Postgresql function....

From: Misa Simic <misa(dot)simic(at)gmail(dot)com>
To: pgsql <pgsql-general(at)postgresql(dot)org>
Subject: Postgresql PL parallel processing inside Postgresql function....
Date: 2012-12-11 15:51:46
Message-ID: CAH3i69mad1VnTzraT3_S2BbjNca3zhLMxye9K3bC7qHEwdThRQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Alex Burkoff 2012-12-11 16:02:25 Re: execution plan is wrong, or the query ?
Previous Message Mihai Popa 2012-12-11 15:28:12 Re: large database