【发布时间】:2017-07-22 09:45:36
【问题描述】:
Postgres 9.6; Centos 6.7 ; 24核
BigTable1 包含 1,500,000,000 行;重量 180GB。
max_worker_processes = 20
max_parallel_workers_per_gather = 12
1) 运行时
EXPLAIN
SELECT
date_id, id1, id2, id3, id4, topdomain, ftype, SUM(imps), SUM(cls)
FROM BigTable1
WHERE
date_id BETWEEN 2017021200 AND 2017022400
AND date_id BETWEEN 2017020000 AND 2017029999
GROUP BY
date_id, id1, id2, id3, id4, topdomain, ftype;
根本没有使用“工人计划:”。为什么?
2) 在定义的会话中运行相同的查询时
set max_parallel_workers_per_gather = 5;
“工人计划:5”出现。执行时间仅缩短了 25%。
2.1) 为什么“Workers Planned:”只出现在这个设置之后? 2.2) 为什么我们在使用 max_parallel_workers_per_gather = 5 运行时看不到更好的改进?
谢谢!
【问题讨论】:
-
你有什么样的硬件?有多少个驱动器?什么类型的驱动器?你的驱动器有多快?那么内存呢?等等。
标签: postgresql parallel-processing explain postgresql-9.6