Chapter 15. Parallel Query

|Chapter 15. Parallel Query |              |                         |                  |                                      |
|:-------------------------:|--------------|-------------------------|------------------|--------------------------------------|
|[Prev](non-durability.html)|[Up](sql.html)|Part II. The SQL Language|[Home](index.html)| [Next](how-parallel-query-works.html)|

---

## Chapter 15. Parallel Query

**Table of Contents**

[15.1. How Parallel Query Works](how-parallel-query-works.html)[15.2. When Can Parallel Query Be Used?](when-can-parallel-query-be-used.html)[15.3. Parallel Plans](parallel-plans.html)[15.3.1. Parallel Scans](parallel-plans.html#PARALLEL-SCANS)[15.3.2. Parallel Joins](parallel-plans.html#PARALLEL-JOINS)[15.3.3. Parallel Aggregation](parallel-plans.html#PARALLEL-AGGREGATION)[15.3.4. Parallel Append](parallel-plans.html#PARALLEL-APPEND)[15.3.5. Parallel Plan Tips](parallel-plans.html#PARALLEL-PLAN-TIPS)[15.4. Parallel Safety](parallel-safety.html)[15.4.1. Parallel Labeling for Functions and Aggregates](parallel-safety.html#PARALLEL-LABELING)

[]()

PostgreSQL can devise query plans that can leverage multiple CPUs in order to answer queries faster. This feature is known as parallel query. Many queries cannot benefit from parallel query, either due to limitations of the current implementation or because there is no imaginable query plan that 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. This chapter explains some details of how parallel query works and in which situations it can be used so that users who wish to make use of it can understand what to expect.

---

|[Prev](non-durability.html)|  [Up](sql.html)  | [Next](how-parallel-query-works.html)|
|:--------------------------|:----------------:|-------------------------------------:|
|14.5. Non-Durable Settings |[Home](index.html)|    15.1. How Parallel Query Works    |

 // \<![CDATA[ \<-- For SVG support if ('WebSocket' in window) { (function() { function refreshCSS() { var sheets = [].slice.call(document.getElementsByTagName("link")); var head = document.getElementsByTagName("head")[0]; for (var i = 0; i \< sheets.length; ++i) { var elem = sheets[i]; head.removeChild(elem); var rel = elem.rel; if (elem.href && typeof rel != "string" || rel.length == 0 || rel.toLowerCase() == "stylesheet") { var url = elem.href.replace(/(&|\\?)\_cacheOverride=\\d+/, ''); elem.href = url + (url.indexOf('?') \>= 0 ? '&' : '?') + '\_cacheOverride=' + (new Date().valueOf()); } head.appendChild(elem); } } var protocol = window.location.protocol === 'http:' ? 'ws://' : 'wss://'; var address = protocol + window.location.host + window.location.pathname + '/ws'; var socket = new WebSocket(address); socket.onmessage = function(msg) { if (msg.data == 'reload') window.location.reload(); else if (msg.data == 'refreshcss') refreshCSS(); }; console.log('Live reload enabled.'); })(); } // ]]\>