I have a couple of queries (2-4) which are independent and results of which I need to concatenate once all are finished.
Since I don't know about how postgresql works under the hood, I am wondering:
- Do queries run in parallel automatically?
- Can I force them to run in parallel if they dont do it automatically?
- Should I do it?
I would like to avoid running them in serial fashion if parallelization is possible.
Pseudo code of my scenario:
(
SELECT func(col1, col2, col3)
FROM table1
JOIN...
WHERE...
)
||
(
SELECT func(col1, col2, col3)
FROM table2
JOIN...
WHERE...
)
||
(
SELECT func(col1, col2, col3)
FROM table3
JOIN...
WHERE...
)