I have created a application which is sending queries using DBLink from many tenant-databases to a single group-database.
An example of a query is the following:
INSERT INTO public.<tableA> (<columns>) SELECT <columns> FROM dblink(<connection>, <statement>) AS rt(<output definition>)
INSERT INTO public.<tableB> (<columns>) SELECT <columns> FROM dblink(<connection>, <statement>) AS rt(<output definition>)
INSERT INTO public.<tableC> (<columns>) SELECT <columns> FROM dblink(<connection>, <statement>) AS rt(<output definition>)
INSERT INTO public.<tableD> (<columns>) SELECT <columns> FROM dblink(<connection>, <statement>) AS rt(<output definition>)
Questions:
- Is this statement run in parallel these four queries?
- How can I check how PostgreSQL is handling the plan? (PGAdmin is not showing complete plan these four queries together)
- If not executing in parallel is there any way to force parallel execution in individual queries in the same statement?