Skip to content

Instantly share code, notes, and snippets.

@portnov
Created August 19, 2023 08:55
Show Gist options
  • Save portnov/3ce82d17ed33b0616564986ddd963a61 to your computer and use it in GitHub Desktop.
Save portnov/3ce82d17ed33b0616564986ddd963a61 to your computer and use it in GitHub Desktop.
count(1)
explain (analyze,buffers)
select count(1)
from bigtable
QUERY PLAN |
----------------------------------------------------------------------------------------------------------------------------------------------------------------------+
Finalize Aggregate (cost=254096.62..254096.65 rows=1 width=8) (actual time=9956.068..9976.581 rows=1 loops=1) |
Buffers: shared hit=158026 read=25297 dirtied=1871 |
I/O Timings: shared/local read=23218.641 |
-> Gather (cost=254096.38..254096.61 rows=2 width=8) (actual time=9956.062..9976.576 rows=3 loops=1) |
Workers Planned: 2 |
Workers Launched: 2 |
Buffers: shared hit=158026 read=25297 dirtied=1871 |
I/O Timings: shared/local read=23218.641 |
-> Partial Aggregate (cost=253096.38..253096.41 rows=1 width=8) (actual time=9799.502..9799.504 rows=1 loops=3) |
Buffers: shared hit=158026 read=25297 dirtied=1871 |
I/O Timings: shared/local read=23218.641 |
-> Parallel Index Only Scan using pk_bigtable on bigtable (cost=0.43..242209.49 rows=4354757 width=0) (actual time=0.074..9614.699 rows=3484407 loops=3)|
Heap Fetches: 1187525 |
Buffers: shared hit=158026 read=25297 dirtied=1871 |
I/O Timings: shared/local read=23218.641 |
Planning Time: 0.080 ms |
Execution Time: 9976.629 ms |
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment