Starting from version 9.6 to even more on 10, PostgreSQL supports parallel queries. As written in the official documentation: "Many queries cannot benefit from parallel query, either due to limitations of the current implementation or because there is no imaginable query plan which is any faster than the serial query plan. However, for queries that can benefit, the speedup from parallel query is often very significant. Many queries can run more than twice as fast when using parallel query, and some queries can run four times faster or even more. Queries that touch a large amount of data but return only a few rows to the user will typically benefit most."
The planner decides when to use this feature and decides it by evaluating ...