November 2019
Beginner to intermediate
470 pages
11h 59m
English
Now that we've introduced the basics of parallelism, we have to learn what it means in the real world. Let's take a look at the following query:
test=# explain SELECT * FROM t_parallel; QUERY PLAN ---------------------------------------------------------------------- Seq Scan on t_parallel (cost=0.00..360621.20 rows=25000120 width=4)(1 row)
Why does PostgreSQL not use a parallel query? The table is sufficiently large and the worker PostgreSQL is available, so why doesn't it use a parallel query? The answer is that interprocess communication is really expensive. If PostgreSQL has to ship rows between processes, a query can actually be slower than in single-process mode. The optimizer uses cost parameters to punish interprocess ...
Read now
Unlock full access