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 运行时看不到更好的改进?
谢谢!。