postgresql 9.3 - Multiple seq scans on the same filters -


i wanted ask why execution of simple query optimizer decide execute seq scan twice using same filter appending results @ end?

select count(*) customers c ((name not null) , (flag = 4) , (birth_date < now())); 

postgresql version 9.3.4 output of explain analyze:

aggregate  (cost=4444780.90..4444780.91 rows=1 width=0) (actual time=50654.137..50654.137 rows=1 loops=1)    ->  append  (cost=0.00..4444776.28 rows=1847 width=0) (actual time=50654.128..50654.128 rows=0 loops=1)          ->  seq scan on customers c  (cost=0.00..4439681.76 rows=1845 width=0) (actual time=50614.774..50614.774 rows=0 loops=1)                filter: ((name not null) , (flag = 4) , (birth_date < now()))          ->  seq scan on customers c  (cost=0.00..5094.52 rows=2 width=0) (actual time=39.349..39.349 rows=0 loops=1)                filter: ((name not null) , (flag = 4) , (birth_date < now()))  total runtime: 50654.245 ms 

borys, better write postgresl mailinglist: pgsql-general@postgresql.org problem sounds quite exotic (since happens you). friendly bunch on there: since postgres9.3 supported.

(sorry, meant comment, not answer.)


Comments

Popular posts from this blog

javascript - RequestAnimationFrame not working when exiting fullscreen switching space on Safari -

Python ctypes access violation with const pointer arguments -