- Mastering PostgreSQL 9.6
- Hans Jurgen Schonig
- 221字
- 2021-07-09 19:57:11
Introducing parallel queries
Traditionally, a query had to run on a single CPU. While this was just fine in the OLTP world, it started to be a problem for analytical applications, which were bound to the speed provided by a single core. With PostgreSQL 9.6, parallel queries were introduced. Of course, implementing parallel queries was hard and so a lot of infrastructure has already been implemented over the years. All this infrastructure is now available to provide the end user with parallel sequential scans. The idea is to make many CPUs work on complicated WHERE conditions during a sequential scan. Version 9.6 also allowed for parallel aggregates and parallel joins. Of course, there is a lot of work left, but we are already looking at a major leap forward.
To control parallelism, there are two essential settings:
test=# SHOW max_worker_processes;
max_worker_processes
----------------------
8
(1 row)
test=# SHOW max_parallel_workers_per_gather ;
max_parallel_workers_per_gather
---------------------------------
2
(1 row)
The first one limits the overall number of worker processes available. The second one controls the number of workers allowed per gather node.
In addition to those fundamental settings, there are a couple of new optimizer parameters to adjust the cost of parallel queries.
- Unreal Engine:Game Development from A to Z
- Visual C# 2008開發技術詳解
- JMAG電機電磁仿真分析與實例解析
- 機器自動化控制器原理與應用
- CompTIA Network+ Certification Guide
- 網絡化分布式系統預測控制
- Implementing AWS:Design,Build,and Manage your Infrastructure
- Visual FoxPro數據庫基礎及應用
- 分析力!專業Excel的制作與分析實用法則
- WOW!Photoshop CS6完全自學寶典
- 空間機器人智能感知技術
- 計算機組裝與維修實訓
- Practical AWS Networking
- Practical Network Automation
- 巧學活用Linux