Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug with PG10 parallel? #3

Closed
digoal opened this issue Jul 1, 2017 · 1 comment
Closed

bug with PG10 parallel? #3

digoal opened this issue Jul 1, 2017 · 1 comment

Comments

@digoal
Copy link

digoal commented Jul 1, 2017

HI,
I use vops with PG 10 beta1, but when i query the countall with parallel, the result is not correct.
Is it a bug?

the real count is :

postgres=# set max_parallel_workers_per_gather =0;
SET
Time: 0.153 ms
postgres=# select countall(*) from vc;
 countall  
-----------
 150000000
(1 row)
Time: 933.433 ms

parallel

ostgres=# set max_parallel_workers_per_gather =2;
SET
Time: 0.110 ms
postgres=# select countall(*) from vc;
 countall 
----------
 71552512
(1 row)

Time: 503.081 ms
postgres=# explain select countall(*) from vc;
                                      QUERY PLAN                                       
---------------------------------------------------------------------------------------
 Finalize Aggregate  (cost=179617.95..179617.96 rows=1 width=8)
   ->  Gather  (cost=179617.94..179617.95 rows=2 width=8)
         Workers Planned: 2
         ->  Partial Aggregate  (cost=179617.94..179617.95 rows=1 width=8)
               ->  Parallel Seq Scan on vc  (cost=0.00..177176.55 rows=976555 width=0)
(5 rows)

Time: 0.313 ms


postgres=# set max_parallel_workers_per_gather =4;
SET
Time: 0.134 ms
postgres=# explain select countall(*) from vc;
                                      QUERY PLAN                                       
---------------------------------------------------------------------------------------
 Finalize Aggregate  (cost=174735.18..174735.19 rows=1 width=8)
   ->  Gather  (cost=174735.16..174735.17 rows=4 width=8)
         Workers Planned: 4
         ->  Partial Aggregate  (cost=174735.16..174735.17 rows=1 width=8)
               ->  Parallel Seq Scan on vc  (cost=0.00..173270.33 rows=585933 width=0)
(5 rows)

Time: 0.331 ms
postgres=# select countall(*) from vc;
 countall 
----------
 46793600
(1 row)

Time: 351.865 ms

best regards, thank you.

@knizhnik
Copy link
Contributor

knizhnik commented Nov 9, 2017

Fixed by commit d153055..8bdc710

@knizhnik knizhnik closed this as completed Nov 9, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants