how to get postgres to do parallel inserts with cte query?

Viewed 241

I have a CTE query returning 750m records, these records need to be inserted into a target table. Using "select * into <> from " clause to parallelize the query part, but is there a way to parallelize the insert part? PostgreSQL version is 11.6.

Would having target table as partitioned help in parallelizing the insert? If so then how to run a CTAS for a partitioned table - lets say hash partitioned table?

1 Answers

There is no way to parallelize INSERTs in PostgreSQL, except by opening several database connections and using them in parallel.

Related