Postgres不应用并行查询

时间:2019-07-03 13:39:06

标签: postgresql-11 postgresql-parallel-query

我正在使用“ PostgreSQL 11.4,由Visual C ++ build 1914编译,64位”

我想运行并行查询以进行测试,以下是我的pg_settings参数值:

"checkpoint_completion_target"    >> "0.5"  
"default_statistics_target"       >> "100"  
"effective_cache_size"            >> "524288" "8kB"
"maintenance_work_mem"            >> "65536" "kB"
"max_connections"                 >> "100"  
"max_parallel_workers"            >> "8"    
"max_parallel_workers_per_gather" >> "2"    
"max_wal_size"                    >> "1024" "MB"
"max_worker_processes"            >> "8"    
"min_wal_size"                    >> "80" "MB"
"random_page_cost"                >> "4"    
"shared_buffers"                  >> "16384" "8kB"
"wal_buffers"                     >> "512" "8kB"
"work_mem"                        >> "4096" "kB"

虽然我尝试解释该查询,但该查询未显示任何“计划的工人”,如何确认我的数据库是否支持并行查询?

++++++++++++++++++++++++++++++++++++++++++++++++ +++++++++++++++++++++++

EXPLAIN select /*+ PARALLEL(test_table 2) */ * from test_table where col_6 = 'Submitted'
--------------------------------------------------------------------
"Seq Scan on test_table  (cost=0.00..3858.50 rows=2633 width=928)"
"  Filter: (col_6 = 'Submitted'::text)"

================================================ =====================

如果我启用了force_parallel_mode,那么它将显示“ Workers Planned”,但始终为1。我的设置或运行并行查询的数据库有什么问题?

++++++++++++++++++++++++++++++++++++++++++++++++ +++++++++++++++++++++++

set force_parallel_mode = on;
--------------------------------------------------------------------
EXPLAIN select /*+ PARALLEL(test_table 2) */ * from test_table where col_6 = 'Submitted'
--------------------------------------------------------------------
"Gather  (cost=1000.00..5121.80 rows=2633 width=928)"
"  Workers Planned: 1"
"  Single Copy: true"
"  ->  Seq Scan on test_table  (cost=0.00..3858.50 rows=2633 width=928)"
"        Filter: (col_6 = 'Submitted'::text)"

================================================ =====================

0 个答案:

没有答案