I have a store procedure
DO_STUFF(obj rowFromMyTable)
This take obj and process some data and save the result in an independent table. So the order i process the objects isn't important.
DO_STUFF(objA); DO_STUFF(objB); < == > DO_STUFF(objB); DO_STUFF(objA);
The thing is want create a store procedure to process all object, but this use only a single CPU.
for each obj in (SELECT obj from tblSOURCE)
loop
DO_STUFF(obj);
end loop;
I want to split the process in multiple CPU so things finish faster.
The only thing i think of was using 2 pgAdmin window and run two different store procedure in each one.
--one window run using the filter
(SELECT obj from tblSOURCE where id between 1 and 100000)
--and the other use
(SELECT obj from tblSOURCE where id between 100001 and 200000)
Any ideas of how should i do this in a single store procedure?