2016-05-17 21:15:17| 分类: Postgres基础 | 标签: |举报 |字号大中小 订阅
[pg96@db1 ~]$ grep "max_parallel_degree" $PGDATA/postgresql.confmax_parallel_degree = 4 # max number of worker processes per node
[pg96@db1 ~]$ psql francs francspsql (9.6beta1)Type "help" for help.francs=> create table test_big1(id serial, name character varying(64),create_time timestamp(0) without time zone);CREATE TABLEfrancs=> insert into test_big1(id,name)select n, n||'_test' from generate_series(1,5000000)n;INSERT 0 5000000
francs=> explain analyze select count(*) from test_big1;-------------------------------------------------------------------------------------------------------------------------------------------------Finalize Aggregate (cost=45560.42..45560.43 rows=1 width=8) (actual time=4236.468..4236.469 rows=1 loops=1)-> Gather (cost=45560.00..45560.41 rows=4 width=8) (actual time=4232.517..4232.556 rows=5 loops=1)Workers Planned: 4Workers Launched: 4-> Partial Aggregate (cost=44560.00..44560.01 rows=1 width=8) (actual time=4182.972..4182.973 rows=1 loops=5)-> Parallel Seq Scan on test_big1 (cost=0.00..41435.00 rows=1250000 width=0) (actual time=0.034..2450.966 rows=1000000 loops=5)Planning time: 112.309 msExecution time: 4236.920 ms(8 rows)
[pg95@db1 ~]$ psql fdb fdbpsql (9.5alpha1)Type "help" for help.fdb=> create table test_big1(id serial, name character varying(64),create_time timestamp(0) without time zone);CREATE TABLEfdb=> insert into test_big1(id,name)select n, n||'_test' from generate_series(1,5000000)n;INSERT 0 5000000fdb=> explain analyze select count(*) from test_big1;QUERY PLAN----------------------------------------------------------------------------------------------------------------------------Aggregate (cost=91435.00..91435.01 rows=1 width=0) (actual time=8389.093..8389.094 rows=1 loops=1)-> Seq Scan on test_big1 (cost=0.00..78935.00 rows=5000000 width=0) (actual time=9.958..4781.116 rows=5000000 loops=1)Planning time: 2.436 msExecution time: 8391.758 ms(4 rows)
评论