The secret is in the Rows Removed by Filter: 10115028
:
It takes the sequential scan 17 seconds to find and return the first result row.
The secret is in the
Rows Removed by Filter: 10115028
:It takes the sequential scan 17 seconds to find and return the first result row.
The optimizer has no idea how long it takes until the first row passes the filter. Since it doesn't make any difference for the quality of the plan, it just sets the startup cost to 0.
Both plans work the same: each of the three processes scans a third of the table and counts the rows (the
Partial Aggregate
that returns 1 row). In the first case, 10 million rows are counted by each worker.These three numbers are gathered and summed in the
Finalize Aggregate
stage.