- 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.
- 人工智能超越人類
- 商戰(zhàn)數(shù)據(jù)挖掘:你需要了解的數(shù)據(jù)科學(xué)與分析思維
- TIBCO Spotfire:A Comprehensive Primer(Second Edition)
- Visual FoxPro 6.0數(shù)據(jù)庫與程序設(shè)計(jì)
- 機(jī)艙監(jiān)測與主機(jī)遙控
- PostgreSQL Administration Essentials
- 基于32位ColdFire構(gòu)建嵌入式系統(tǒng)
- 水下無線傳感器網(wǎng)絡(luò)的通信與決策技術(shù)
- Flink原理與實(shí)踐
- 工業(yè)機(jī)器人實(shí)操進(jìn)階手冊
- PHP求職寶典
- Practical AWS Networking
- 機(jī)器人剛?cè)狁詈蟿恿W(xué)
- Appcelerator Titanium Smartphone App Development Cookbook(Second Edition)
- 實(shí)戰(zhàn)大數(shù)據(jù)(Hadoop+Spark+Flink):從平臺構(gòu)建到交互式數(shù)據(jù)分析(離線/實(shí)時(shí))