There is a plpgsql script that have a loop to carry out the same recursive queries.
The estimation of iteration is in the order of tens of thousands.
What is the best way of making using parallel query strategy.
An example would be helpful.
However, as a general guideline, since parallelism is done at the per-row scope, removing looping logic from the script and turning the main script logic into one or more functions that operate on a single row, while obeying the rules such functions need to abide by in order to be marked parallel safe, will open up the possibility for the server to process different rows using different workers and then appending their results together for the next node to consume.