Postgres does not apply parallel query

1.1k Views Asked by At

I am using "PostgreSQL 11.4, compiled by Visual C++ build 1914, 64-bit"

I want to run parallel query for testing purpose, below is my pg_settings parameter values:

"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"

While I try to explain the query it doesn't show any 'Workers Planned' how to confirm if my DB support parallel query or not?

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

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)"

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

If i enable force_parallel_mode then it shows 'Workers Planned' but always value with 1. what is the wrong with my setting or DB to run parallel query?

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

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

There are 0 best solutions below