The following query
EXPLAIN SELECT c.global_id FROM centers_res17 AS c LEFT JOIN regions_res17 AS r ON ST_Contains(r.wkb_geometry, c.wkb_geometry) WHERE r.global_id IS NULL;
says that a Parallel Sequential Scan on
centers_res17 will be used. This is good and the query is fast (8 workers are used, and the CPU is busy)
Now, if I do a
SELECT c.global_id INTO foo the query plan indicates a Sequential Scan, which is much slower.
I tried to:
CREATEthe foo table before (also as a
- Wrap the above statement in a
WITHclause and then select its results into foo.
CREATE foo AS (^^Above statement^^)
None of the above uses multiple workers to do a Parallel Sequential Scan (according to the query plan and actually running the query). I could just make the select statement 'as is' and then copy-paste the values from my results window ... not optimal.
Please explain to me, why the Parallel Sequential Scan is not used, or how to modify my query to have the results selected into
I am using PostgreSQl 9.6 on Win10.